RE: [PHP-DB] Stupid newbie looping MySQL question
| From: | Lynn Siprelle | Date: | Sun, 07 Jan 2001 19:06:05 +0000 |
| Subject: | RE: [PHP-DB] Stupid newbie looping MySQL question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5684@lists.php.net to get a copy of this message | ||
>Ma'am, I'm not an expert on the inner workings of PHP, but here's what I think is
>happening.
Very astute, sir! And quite possibly what is happening, though when I put an error check routine
into this line, per the advice of other helpful people here:
>>$result = mysql_query ("Select name from mytable");
it tells me that it's getting zero results from the get-go. Would it give me that if it were a
buffer problem?
Question:
>And in the bunch more stuff, you run another mysql_query(), which replaces the result table in
>the buffer with the result table from the new query. If the result of the second query is assigned
>to a variable other than $result, then $result now points to a nonexistent result table. On the
>second pass through the while loop, mysql_fetch_array($result) returns an error, because there is no
>longer anything to fetch.
Would it help if I used, say, $result2 $row2 etc for the second set of query/results?
>Look at it this way. You had to wait until you had finished running fetch_baby(Josephine) before
>you could start running fetch_baby(Louisa).
>There's only one buffer!
rofl!
>If I am correct, then the solution is to load the result table from the first query into the
>array $rows, and then process the result array to extract the data for your second query.
I thought that's what I was doing, but maybe not.
>Wean them on Unix. Windows will cripple their social development. Imagine the trauma of a 2 year
>old shunned by the other children because she can't grep a text file!
The only Windows box at our house is my husband's laptop, which is for work only. We are
otherwise a Mac and *nix household. Josie already has an ethernet port in her bedroom. We're
gonna raise her up right.
>There have been warnings that excessive exposure to computers too early can skew a person's
>perception of reality as an adult. But I don't know of any cases where this has actually
>happened.
Well, Josie's exposure to her Blue's Clues CD are skewing MY perceptions of reality, since
she plays it while I'm trying to program. Crikeys, I feel like I'm playing Blues Clues
trying to figure this out. A clue! a clue! note to self: hide that damn CD...
L
who knows the childless out there have no idea what I'm talking about...
--
Lynn Siprelle, Siprelle & Associates: Web Construction and Publishing
Chief Assoc. Josephine b. 9/9/97 * New Assoc. Louisa due 5/1/01
Business: lynn@siprelle com | Personal: lynsa@siprelle.com
The New Homemaker: http://www.newhomemaker.com/