Re: Getting One Row of a result
| From: | _lallous | Date: | Wed, 10 Oct 2001 08:07:52 +0000 |
| Subject: | Re: Getting One Row of a result | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13184@lists.php.net to get a copy of this message | ||
mysql_fetch_array() will do....ofcourse if you know there is one result, no
need to put it inside a loop.
you can also use mysql_result()
"Jordan Elver" <jord@theinternetone.co.uk> wrote in message
news:01100912000005.01857@jordan.utopia.net...
> Hi,
> If I know that a query is only going to return one record, what is the
mmost
> efficient way of fetching that result and getting it into a variable?
>
> I currently use mysql_fetch_array with list, like:
>
> while(list($vars_here) = mysql_fetch_array($result)) {
>
> // do stuff
> }
>
> ANy help would be good,
>
> Thanks,
>
> Jord