I have a php script that keeps outputting the same row more than 100 times! I really dont know how this is happening so hopefully you guys will know and tell me
PHP Code:
while($post = mysql_fetch_array(mysql_query("select * from table_posts where topic='$id'")))
{
echo($post['body']);
echo($post['userid']);
echo($post['date']);
echo("<br/>");
}
__________________
My webmaster news & tips blogs with free scripts and tutorials - Please login or register to view this content. Registration is FREE
I would output $id and see if it's actually what it's supposed to be. And you might wanna try mysql_fetch_assoc() instead of _array, because I was having a problem like this using _array(), and switching to _assoc() fixed it.
Ok I'll try your idea kbfirebreather, it seems good. And the variable $id is just $id=$_GET['id'];
__________________
My webmaster news & tips blogs with free scripts and tutorials - Please login or register to view this content. Registration is FREE
« Reply to PHP script outputting table row more than once