我需要帮助。如果我的代码显示结果
while($row = mysql_fetch_array($find)) is true
现在我想如果条件不正确,那么它将显示“未找到数据”
就像如果其他
if(condition)
statement1;
else
statement2;
我的代码在哪里:
<form class="contact_form5" action="search.php" method="post" name="contact_form">
<ul>
<h3 align="center">Following search matches </h3>
<?php
echo "<table width='650' border='0' cellpadding='3' cellspacing='1' class='black12' align='center' >";
echo "<tbody class='black12'>";
echo "<tr class='black12bold'>";
echo "<td width='19%' align='left' valign='middle' bgcolor='#AFB7BE'>First Name</td>";
echo "<td width='19%' align='left' valign='middle' bgcolor='#AFB7BE'>Last Name</td>";
echo "<td width='19%' align='left' valign='middle' bgcolor='#AFB7BE'>Gender</td>";
echo "<td width='19%' align='left' valign='middle' bgcolor='#AFB7BE'>Occupation</td>";
echo "<td width='19%' align='left' valign='middle' bgcolor='#AFB7BE'>Blood Group</td>";
echo "</tr>";
while($row = mysql_fetch_array($find)){
echo "<tr class='black12bold'>";
echo "<td align='left' valign='middle' bgcolor='#EEEEEE'>".$row['DRFname']."</td>";
echo "<td align='left' valign='middle' bgcolor='#EEEEEE'>".$row['DRLname']."</td>";
echo "<td align='left' valign='middle' bgcolor='#EEEEEE'>".$row['DRGender']."</td>";
echo "<td align='left' valign='middle' bgcolor='#EEEEEE'>".$row['DROccupation']."</td>";
echo "<td align='left' valign='middle' bgcolor='#EEEEEE'>".$row['DRBloodGroup']."</td>";
?>
<?php
echo "</tr>";
echo "</tbody>";
}
echo "</table>";
?>
</li>
</ul>
</form>
请给我一些想法我该怎么做。谢谢