Re: accessing mysql_fetch_array more than once?
| From: | Chris Knipe | Date: | Fri, 17 May 2002 18:25:16 +0000 |
| Subject: | Re: accessing mysql_fetch_array more than once? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98166@lists.php.net to get a copy of this message | ||
Didn't do the trick....
But it did point my towards mysql_data_seek, which did the job beautifully
:)
Thanks
--
me
----- Original Message -----
From: "Rasmus Lerdorf" <rasmus@php.net>
To: "Chris Knipe" <savage@savage.za.org>
Cc: <php-general@lists.php.net>
Sent: Friday, May 17, 2002 7:04 PM
Subject: Re: [PHP] accessing mysql_fetch_array more than once?
> 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
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>