Re: Finding current MySQL Row number
| From: | Jake Malone | Date: | Mon, 05 May 2003 18:02:56 +0000 |
| Subject: | Re: Finding current MySQL Row number | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27538@lists.php.net to get a copy of this message | ||
scotty,
i like to use for() to retrieve rows in a result set, which makes it really
easy to get the row number. example:
for ($i=0;$i<mysql_num_rows($result);$i++) {
// Add 1, because the index $i starts at 0
echo "Row: ".($i+1);
}
"Scott Teglasi" <steglasi@mediaglue.com> wrote in message
news:PCEMLDGDPKCPHDPMLKGDAEAICAAA.steglasi@mediaglue.com...
> Hi all,
>
> I wanted to know if there's a function or some way of finding out what the
> current row that a mysql resultset is located on.
>
> Any help would be appreciated.
>
> Thanks!
>
> Scotty
>