例如,如果用户在我们的数据库中没有照片,那么行显示默认照片我该怎么做,请帮助我,谢谢
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_num_rows($result);
echo "<table class='hovertable' border='1' cellpadding='0' cellspacing='0'>";
echo "<tr><th>Photo</th><th>Teacher Detail</th></tr>";
if ($rows > 0) {
while($row = mysql_fetch_array($result)) {
echo "<tr><td align='center'>";
echo "<img src=images/".$row['photo'] ." width='90' height='90'></a></td>";
echo '<td valign="top">Teacher Name: ';
echo $row['name'], '<br/>';
echo 'Teacher No: ';
echo $row['teacherno'], '<br/>';
echo 'Father Name: ';
echo $row['fathername'], '<br/>';
echo '</td></tr>';
}
} else {
echo "<tr><td colspan=\"5\">No results found!</td></tr>";
}
echo "</table>"