Not running query on second loop

From: Date: Wed, 26 Jul 2000 20:54:44 +0000
Subject: Not running query on second loop
Groups: php.general 
Request: Send a blank email to php-general+get-8394@lists.php.net to get a copy of this message
I have a query within a while statement and it only seems to be hitting the lower query once. (only on the first loop. Never on the second.) I have messed with this for about an hour and can't find out why. Can someone see if they see what it going on? I do know there are atleast 2 records in the DB. $result = mysql_query("select * from lottouser where month='$month' AND day='$bday'") or die(mysql_error()); while($row = mysql_fetch_array($result)){ $id = $row["id"]; $fname = $row["fname"]; $lname = $row["lname"]; $emailaddr = $row["emailaddr"]; echo $id;?> - <? echo $fname;?> <? echo $lname;?> - <? $sql2 = "select user_id from bonus_plays WHERE user_id = $id"; $lookupresult = mysql_query("select user_id from bonus_plays WHERE user_id = $id") or die(mysql_error()); while ($lookuprow = mysql_fetch_array($lookupresult)){ $user_id = $lookuprow["user_id"]; echo $sql2;?><BR><? //It hits this line only once. } } thanks CDitty

« previous php.general (#8394) next »