Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEED HELP... selecting the last record from a table

Status
Not open for further replies.

ares666

Programmer
Jun 20, 2003
7
0
0
RO
Hello all,

This is my problem:
I have a table with all kinds of fields, a table from a post-nuke Content Management System.(post_sories)

I cant seem to find the syntax for an MySQL instruction, that of selecting the last record inserted into this table.

There are some auto incrementing fields, and I don't know how to write the SELECT statement in order for it to retrieve only the last piece of information from the table.

Could anybody help me please?

Thank you in advance.


 
Code:
select * from postNukeTable
order by autoIncementColumn desc
limit 1
 
Thank you very much...

IT WORKED!!!

u got my vote.


 
ares666 here vote means star for swampBoogie where is it ? to mark just check at the bottom of swampBoogie's reply to yr query



[ponder]
----------------
ur feedback is a very welcome desire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top