I'm using the function mysql_fetch_assoc
to return the data in database, but I don't know how to print its result in a table.
Here is the code that does the process.
$number_of_date= "SELECT SUM(number_of_date) AS number_of_date FROM emp_leaves WHERE emp_id='$userID' AND leave_category='Annual' AND apply_year='$year'";
$res_qry = mysql_query($number_of_date) or die ('Invalid query :: <br/>'.$number_of_date.' <br/>'.mysql_error());
$rowqry = mysql_fetch_assoc($res_qry);
$number_date = $rowqry ['number_of_date'];
<tr>
<?php while($rowqry = mysql_fetch_assoc($res_qry)) { ?>
<td><?php echo $rowqry ['number_of_date']?></td>
<?php } } ?>
</tr>
It does not work. What is the correct way to display this result ?