View Full Version : how to get last row

03-14-2008, 12:18 PM
assume we have a table "user" and 2 fields : "idname" and "idhome" .
I need to find the LAST row and last "idname".I mean any php code to return the last "idname"

Thanks for your support as usual :)

03-14-2008, 02:33 PM
You haven't said about the type of your fields.
If you have an auto-increment field or any date fields, you can use the max() say

select something from somewhere where auto_id= max(auto_id)