> -Original Message-
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 12, 2001 10:52 PM
> To: Dan Harrington
> Cc: speedboy; [EMAIL PROTECTED]
> Subject: RE: [PHP] Invalid MySQL result resource
>
>
> > $productresult = mysql_que
On Thu, 13 Sep 2001 14:22, David Robley wrote:
> > Here's what's going on.
> >
> >
> > $connection = mysql_connect($server, $user, $pass);
> > mysql_select_db($db);
> >
> > $query = "select * from shoppingcart where PHPSESSID = '$PHPSESSID'"
> $productresult = mysql_query($productquery);
> $productinfo = mysql_fetch_array($productresult); //THIS line produces the error
Well, you don't check for errors. Always always always perform proper
error checking:
$productresult = mysql_query($productquery) or die(mysql_error());
Do that an
On Thu, 13 Sep 2001 14:15, Dan Harrington wrote:
> > -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
> >
>
On Thu, 13 Sep 2001 13:53, Dan Harrington wrote:
> Hello,
>
> What is the best way to accomplish the following?:
>
> Connect to MySQL database
> Execute a query
>
> Fetch a row from that query (mysql_fetch_array)
> Based on the data from the original query, generate a second query
> Ex
> -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
> "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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
Hello,
What is the best way to accomplish the following?:
Connect to MySQL database
Execute a query
Fetch a row from that query (mysql_fetch_array)
Based on the data from the original query, generate a second query
Execute the second query
Fetch a row from the second que
8 matches
Mail list logo