Thanks for the info. I tried using mysql_free_result() and mysql_close($db)
and opening the DB again for the second query with the same results. I
haven't tried using a different variable for $result.
----- Original Message -----
From: "Steve Yates" <[EMAIL PROTECTED]>
To: "MySQL List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 18, 2002 1:32 AM
Subject: Re: MySQL and PHP question
> On Wed, 18 Dec 2002 22:54:53 -0500, C. Reeve wrote:
> >while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
> > $num1 = $line['number'];
> >}
>
> Loop through the result and return the value from the last row?
> Did you want "select sum(number) as SubTotal1 from table1 where
> userid=$user1"?
>
> >$query "select number from table2 where userid=$user2";
> >$result = mysql_query($query) or die("Query failed");
>
> You re-used the same variable $result. Offhand I would try
> using a second variable, and/or using mysql_free_result() in between.
>
> - Steve Yates
> - My hard disk is full! Maybe I'll try this message section thing.
>
> ~ Taglines by Taglinator - www.srtware.com ~
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php