hello. is that possible to hide an empty table when there is no records found from the mysql database. if possible, how? i have no idea to do it. hope anyone can help me. below is part of my coding:
<?php
$count=0;
include 'dbconnect.php';
if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
$startrow = 0;
} else {
$startrow = (int)$_GET['startrow'];
}
if (isset($_GET['serial_no']))
$serial_no = $_GET['serial_no'];
else
$serial_no = 0;
$query = "SELECT * FROM log where serial_no = '$serial_no'";
$result = mysql_query($query) or die('SQL error');
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
?>
<TR>
<td align="center" height="29"><font class="style3"><?php $count=$count+1; print($count);?></font></td>
<TD><font class="style3"> <?php echo $row['serial_no']; ?></font></TD>
<TD><font class="style3"> <?php echo $row['taken_date']; ?></font></TD>
<TD><font class="style3"> <?php echo $row['return_date']; ?></font></TD>
<TD><font class="style3"> <?php echo $row['person_incharged']; ?></font></TD>
<TD><font class="style3"> <?php echo $row['latest_action']; ?></font></TD>
</TR>
<?php
}
if($count< 1)
{
echo 'No records found';
}
?>