pulling last record from a database
Hi all,
Im hoping someone can help me a little. Im developing a new site. The site lists records from a SQL database, and im using php.
I want to make a feature of the last record added to the database. I can do this in my own primative way by querying the database as to how many records there are each time the page is shown, then echoing the record at the result.
ie
How many records are there?
answer 100
echo record 100
Im assuming this is using a lot of resources though, and there's probably a way of directly asking for the last record?
Any help is much appreciated.
Carl
|