Re: accessing mysql_fetch_array more than once?
| From: | Rasmus Lerdorf | Date: | Fri, 17 May 2002 17:04:39 +0000 |
| Subject: | Re: accessing mysql_fetch_array more than once? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98131@lists.php.net to get a copy of this message | ||
reset()
On Fri, 17 May 2002, Chris Knipe wrote:
> Hi all,
>
> Howcome, when I do a SQL lookup, I can only access the array once?
>
> Say, I have...
>
> <?
> $SQL = mysql_query("SOME SELECT STATEMENT");
> while ($var = mysql_fetch_array($SQL)) {
> echo $var['columbname'];
> }
>
> // that works, and prints out the rows in the table
> // my codes continues.....
>
> ?>
>
> <some more html crap>
>
> <?
> while ($var = mysql_fetch_array($SQL)) {
> echo $var['columbname'];
> }
> // Now, the array doesn't print anything...
> ?>
>
> --
> me
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>