Re: mysql_fetch_array problem...!
| From: | Darryl Friesen | Date: | Mon, 05 Mar 2001 13:46:48 +0000 |
| Subject: | Re: mysql_fetch_array problem...! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7121@lists.php.net to get a copy of this message | ||
> How can I refer to one specific row in this query..?
> What I mean is, how can i refer to result row number 4...?
>
> If I only selected rows from one table I could do something like this:
>
> $i = mysql_fetch_array($sql) ;
> echo "$i[4]" ;
Actually, no. mysql_fetch_array return the _current row_ from the query
(use this function in a loop to process each row of the resulting data).
$i[4] in your case is the fourth field in the current row.
If you really don't want to process the rows in order, look at the
documentation for mysql_data_seek; it can be used to jump around the result
set.
- Darryl
----------------------------------------------------------------------
Darryl Friesen, B.Sc., Programmer/Analyst Darryl.Friesen@usask.ca
Education & Research Technology Services, http://gollum.usask.ca/
Department of Computing Services,
University of Saskatchewan
----------------------------------------------------------------------
"Go not to the Elves for counsel, for they will say both no and yes"