Re: Finding current MySQL Row number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
PCEMLDGDPKCPHDPMLKGDAEAICAAA.steglasi@mediaglue.com">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
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux