RE: [PHP] Not running query on second loop
| From: | Jason Wong | Date: | Thu, 27 Jul 2000 09:27:26 +0000 |
| Subject: | RE: [PHP] Not running query on second loop | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8501@lists.php.net to get a copy of this message | ||
Could it be that your second query over-writes the first? Shouldn't they be
using different connection IDs?
rgds
-
Jason Wong
Digital View Ltd
2201 Nanyang Plaza
57 Hung To Road
Kwun Tong
HONG KONG
Tel: +852-2861-3615
Fax: +852-2520-2987
www.digitalview.com
> -----Original Message-----
> From: Christopher Ditty [mailto:CDitty@email.usps.gov]
> Sent: 27 July 2000 04:55
> To: php-general
> Subject: [PHP] Not running query on second loop
>
>
>
> 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
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>