extract(mysql_fetch_array($result));

sets all the variables at once. much neater :)

Maatt

"Jordan Elver" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to