not display data

admin

Administrator
Staff member
If I dont have a image in a database how would i write it so if the image wasnt there it would show nothing or anaoher image. Here is my code so far
$sql= "SELECT * FROM news ORDER BY newsid";
$result =@mysql_query($sql, $connection) or die("Couldnt excecute query.");
while ($row = mysql_fetch_array($result)) {
$title =$row['title'];
$image =$row['image'];
$news =$row['news'];
$date =$row['date'];

$display_news .="<table border=0 cellpadding=0 cellspacing=0 align=center width='372'>
<tr>
<td class='newstitle' colspan='2'> $title </td>
<td width='118'><img src='http://www.phpbuilder.com/board/archive/index.php/images/$image' width='15' height='1'></td>
</tr>
<tr>
<td><img src='http://www.phpbuilder.com/board/archive/index.php/images/$transparent' width='30' height='1'>$news</td>
</tr>
<tr>
<td class='date' align=right>$date</td>
</tr>

</table >";
}
 
Back
Top