On Friday, January 19, 2001, at 10:15 AM, Chad Day wrote:

> I need some help selecting the last row in my database, and then moving 
> backwards.. I can't just get mysql_num_rows and go back by 1, as some of the 
> records are missing.. the ID field might have #'s like 1950, 1948, 1947, 
> 1944, etc, and I don't want it to break by mistakingly trying to grab 1949. 
> Can someone provide some help or a link to where in the manual what I'm 
> doing might be explained?  Been searching, no luck yet.  Thanks! 

the best thing to do is to select the results in the inverse order, by using the desc 
keyword with the order by clause.

FROM myTable
WHERE something='somethingElse'

but if that won't work do:

$query="select ...



for($i=$rowTotal; $i > 0; $i=($i-1)) {

        $jumpTo=mysql_data_seek($rowTotal, $result); // arguments may be in the wrong 



have a great day,

:: Andrew Rush :: Lead Systems Developer :: MaineToday.com ::
"Crippled but free, blind all the time, i was learning to see"

- J. Garcia / R. Hunter

The  views expressed herein are not necessarily those of my employer, but they let me 
have them anyway.
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to