Re: Need row number from database select
| From: | John Simpson | Date: | Sun, 14 Apr 2002 11:17:41 +0000 |
| Subject: | Re: Need row number from database select | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92920@lists.php.net to get a copy of this message | ||
If you know you're looking for Bob or Mike or John, you could select the
rows each time in your loop as an associative array.
mysql_fetch_array(result, MYSQL_ASSOC)
will do the trick.
"Sp" <internetracer@yifan.net> wrote in message
news:NDBBJHKAELJNNJMBMFHDGEDNCOAA.internetracer@yifan.net...
> If this is my database result from a select then I need to know that Bob
is
> the 1st result, Mike is the 2nd result and John is the 3rd result ...
>
> Name Address
> ======== ===============
> Bob 121 King St.
> Mike 99 Main St.
> John 8433 Albert St.
>
> Does mysql keep track of this? I know I could just do a $i++ as I loop
> through the results but I'm doing something recursively so the counter
> doesn't work here.
>
>