> -----Original Message-----
> From: speedboy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 12, 2001 10:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Invalid MySQL result resource
>
>
> > "Supplied argument is not a valid MySQL result resource in ..... on line 52"
> >
> > Line 52 is the line where I fetch the row from the second query.
>
> Don't keep doing a mysql_connect on each loop.
>
....thats whats weird about this,
I'm not.
Here's what's going on.
========================================================
$connection = mysql_connect($server, $user, $pass);
mysql_select_db($db);
$query = "select * from shoppingcart where PHPSESSID = '$PHPSESSID'";
$result = mysql_query($query,$connection);
$numrows = mysql_num_rows($result);
$count = 0;
while ($count < $numrows){
$cartitem = mysql_fetch_array($result);
$productquery = "select * from products where productid = '$cartitem[productid]'";
$productresult = mysql_query($productquery);
$productinfo = mysql_fetch_array($productresult); //THIS line produces the error
$count++;
}
mysql_close($connection);
========================================================
I don't get it. I must be blind or something because I just don't
see whats causing this.
Thanks again,
Dan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]