$sql= "SELECT * FROM news ORDER BY newsid";
$result =@($sql, $connection) or die("Couldnt excecute query.");
// the following while means, as I understand it that if no rows are returned nothing is output
// and if many rows are returned then many tables are displayed.
//If you want to display something in case there is no row returned you should check with
// if(mysql_num_rows($result)==0)
// {
// alternate text here
// }
// else
// {
// the following while loop here
// }
while ($row = mysql_fetch_array($result)) {
$title =$row['title'];
$image =$row['image'];
// CODE CHANGE HERE >>>>
if ($image=="") // CHECK FOR NULL STRING WHICH SHOULD BE DEFAULT FOR YOUR FIELD
{
$image=%YOUR ALTERNATE FILE IN CASE OF NULL%;
}
// you use a $transpartent file also, maybe that should be checked too
// END CODE CHANGE >>>>
$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='images/$image' width='15' height='1'></td>
</tr>
<tr>
<td><img src='images/$transparent' width='30' height='1'>$news</td>
</tr>
<tr>
<td class='date' align=right>$date</td>
</tr>
</table >";
}
Saludos
Gerardo