I have a problem with my script.
I have this:
<?php
$r=mysql_query("SELECT * FROM memberships WHERE id!='".$userdata['membership']."'");
while($md = mysql_fetch_assoc($r)):
echo '<td class="header">'.$md['name'].'</td>';
endwhile;
?>
That works. But if further down the page, I add this:
<?php
while($md = mysql_fetch_assoc($r)):
echo '<td class="result">'.$md['number_of_ads'].'</td>';
endwhile;
?>
It doesn’t output anything. Why?
Maybe because there’s no more elements to fetch. Not sure what you are trying to accomplish, but if you want to fetch the data back from the beginning, you need to add this before the second block of code:
That will reset the internal pointer to the beginning.