Display the results of mysql_fetch_assoc in a table
<p>I'm using the function <code>mysql_fetch_assoc</code> 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.</p>

<pre><code>$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 :: &lt;br/&gt;'.$number_of_date.' &lt;br/&gt;'.mysql_error());

$rowqry = mysql_fetch_assoc($res_qry);
$number_date = $rowqry ['number_of_date'];
&lt;tr&gt;
    &lt;?php while($rowqry = mysql_fetch_assoc($res_qry)) { ?&gt;
        &lt;td&gt;&lt;?php echo $rowqry ['number_of_date']?&gt;&lt;/td&gt;
    &lt;?php } } ?&gt;
&lt;/tr&gt;
</code></pre>

<hr>

<p>It does not work. What is the correct way to display this result ?</p>