Jump to content

Extract last row of a query.


contiw

Recommended Posts

AbraCadaver's method is what you should go with, but if not possible for whatever reason here's an alternative that will advance the result pointer to the last row returned:

 

$total = mysql_num_rows($query);
mysql_data_seek($query, $total-1);

Once you've "seeked" to the last row, mysql_fetch_*() will return the data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.