RE: [PHP-DB] Using a loop on a result destroys array??
| From: | Mark Benson | Date: | Wed, 24 Nov 2004 15:06:26 +0000 |
| Subject: | RE: [PHP-DB] Using a loop on a result destroys array?? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37399@lists.php.net to get a copy of this message | ||
On Wednesday, November 24, 2004, at 02:40PM, Norland, Martin <Martin.Norland@STJUDE.ORG>
wrote:
>The real problem you're having is the statement says "while there are
>results in this query, grab them" - once you reach the end of the first
>while loop, there are no more results, so the second one is skipped
>right over - it's condition *never* evaluates true.
So by running a "while (mysql_fetch_array($result)" loop over a fetch array you
effectively empty it?
>If the query isn't changing, and there aren't other conditions/etc. -
>then just grab all the data the first time through and put it where it
>needs to go.
OK, sounds like a plan...
Sorry (again) about the code gaffs :-S
--
Mark Benson
http://homepage.mac.com/markbenson