RE: [PHP-DB] mysql_result()
| From: | Mark Roedel | Date: | Wed, 04 Apr 2001 15:59:54 +0000 |
| Subject: | RE: [PHP-DB] mysql_result() | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-8212@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jordan Elver [mailto:jjelver@worldsites.net]
> Sent: Wednesday, April 04, 2001 10:46 AM
> To: PHP Database Mailing List; PHP General Mailing List
> Subject: [PHP-DB] mysql_result()
>
>
> If I knnow that a query will only retrun one row, can I do
> this (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');
Looks reasonable to me...what happens when you try it?
---
Mark Roedel (roedelm@letu.edu) || "There cannot be a crisis next week.
Systems Programmer / WebMaster || My schedule is already full."
LeTourneau University || -- Henry Kissinger