Forum Moderators: coopster
// connect to db
$mysqli = mysql_connect(localhost,root,root);
@mysql_select_db(btc) or die( "Unable to select database");
$sql2="SELECT * FROM project_stages WHERE Project_ID = ".$project_id." ORDER BY Stage_No ASC";
$result2=mysql_query($sql2);
$num=mysql_numrows($result2);
// loop through the table called 'project_stages' and store the results in the variable chosen
$i=0;
while ($i < $num) {
$stage_no=mysql_result($result2,$i,"Stage_No");
$title=mysql_result($result2,$i,"Title");
$text=mysql_result($result2,$i,"Text");
$image=mysql_result($result2,$i,"Image");
$download=mysql_result($result2,$i,"Download");
//prin the results into a table
$display_block2 = "
<center>
<table class=logged_in_table border=0 bgcolor=#696969>
<td class=td_white colspan=2><b>Stage Title:</b> ".$stage_no." - ".$title."</td>
<tr>
<td class=td_blue colspan=2><b>Description & Status</b></td>
</tr>
<tr>
<td class=td_white colspan=2>".$text."</td>
</tr>
<tr>
<td class=td_blue><b>Image Download</b></td><td class=td_blue><b>File Download</b></td>
<tr>";
// if the image or download field is empty display 'No Data Exsists'
if ($result2 == "") {
$display_block2 .= "
<td class=td_white><p>No Data Exsists</p></td><td class=td_white><p>No Data Exsists</p></td>
</table>
<br>
<br>";
} else {
// or print the actual file names
$display_block2 .= "
<td class=td_white><a href=\"http://www.test.somedomain.co.uk/images/".$image."\">".$image."</a></td><td class=td_white>
<a href=\"http://www.test.somedomain.co.uk/downloads/".$download."\">".$download."</a></td>
</table>
<br>
<br>";
}
// now print the results
echo "$display_block2";
$i++;
}
?>
<td class=td_white><p>No Data Exsists</p></td><td class=td_white><p>No Data Exsists</p></td> creating 2 tds, when i just want the text read in. it is hard to put into words.