I can find the Id number of last entry with
$iD=mysql_insert_id();
but need to get the last number with out adding any new record
Its prob very easy but I can't find it can you help
thanks brian
[SOLVED] please how to find last row
Moderator: General Moderators
Code: Select all
select max(`name_of_the_field`) from `name_of_the_table`;thank you so much
thanks for the fast responce it works I could'nt move ahead with out it
thanks this looks good to
I will try using this but con't quit under stand what DESC LIMIT 1 is
but will look on google to learn about it thanks
but will look on google to learn about it thanks
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
he meant:...sort by 'some_field' in descending order.
Code: Select all
SELECT * FROM `table_name` ORDER BY `some_field` DESC LIMIT 1