Nouman Ahmad Khan Nouman Ahmad Khan - 7 months ago 52
MySQL Question

Get last record in mysql using php

How can I SELECT the last row in a MySQL table using php?
I have 3 columns id(AI), longitude and latitude.
DBName: fts
TableName: currentlocation

Thanks for the response guys,
I have acquired right results by using such query
SELECT longitude, latitude FROM currentlocation ORDER BY id DESC LIMIT 1


You can add the following to the end of your query:

order by id desc limit 1