Re: mysql_result()
| From: | matt | Date: | Wed, 04 Apr 2001 15:43:13 +0000 |
| Subject: | Re: mysql_result() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47078@lists.php.net to get a copy of this message | ||
extract(mysql_fetch_array($result));
sets all the variables at once. much neater :)
Maatt
"Jordan Elver" <jjelver@worldsites.net> wrote in message
news:01040416455802.01177@jordan.worldsites.inty.net...
> Hi,
> If I knnow that a query will only retrun one row, can I do thiss (below)
> rather than using a while loop for one record?
>
> $id = @mysql_result($result, 0, 'id');
> $name = @mysql_result($result, 0, 'name');
> $email = @mysql_result($result, 0, 'email');
> $address1 = @mysql_result($result, 0, 'address1');
> $address2 = @mysql_result($result, 0, 'address2');
> $town_city = @mysql_result($result, 0, 'town_city');
> $postcode = @mysql_result($result, 0, 'postcode');
>
> Cheers,
>
> Jord
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>