while loop fetches same first value
<p>I have used a <code>while</code> loop to print database values in row. The query is working as expected, fetching rows according to the total records in the database. </p>

<p>However, the loop is fetching the same value for all rows. If I have <code>a,b,c,d,e</code>, then it fetches <code>a,a,a,a,a</code> from all the rows.</p>

<p>My code is:</p>

<pre><code>&lt;?php 

$sql = mysql_query("
SELECT * 
FROM album 
WHERE status != 'Delete' 
LIMIT {$startpoint} , {$limit}
") or die( mysql_error());

$j = 1; 

while($result = mysql_fetch_assoc($sql)) {

?&gt;
&lt;tr &lt;?php if($j % 2 != '0') echo "style='background-color:#DFFFFE'"; else echo "style='background-color:#EDFFFF'"; ?&gt;&gt;
 &lt;td&gt;&lt;input name="check[]" type="checkbox" value="&lt;?php echo fetch_table_album( $result["aid"], '1', '3' );?&gt;" id="checkbox_&lt;?php echo fetch_table_album( $result["aid"], '1', '3' );?&gt;"&gt;&lt;/td&gt;
 &lt;td class="navigation"&gt;&lt;a href="album.php?aid=&lt;?php echo fetch_table_album( $result["aid"], '1', '4' );?&gt;&amp;id=&lt;?php echo fetch_table_album( $result["aid"], '1', '6' );?&gt;"&gt;&lt;?php echo  fetch_table_album( $result["aid"], '1', '5' );?&gt;&lt;/a&gt;&lt;/td&gt;
 &lt;td&gt;&lt;?php echo fetch_table_album( $result["aid"], '1', '8' );?&gt;&lt;/td&gt;
 &lt;td&gt;&lt;?php echo fetch_table_album( $result["aid"], '1', '10' );?&gt;&lt;/td&gt;
 &lt;td style="cursor:pointer;"&gt;&lt;?php echo fetch_status_image( fetch_table_song( $result["aid"], '1', '13' ));?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php

    $j++;
}

?&gt;
</code></pre>
