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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting ID of current record

Status
Not open for further replies.

s4dadmin

Programmer
Apr 27, 2003
107
US
I have converted from Access to mysql. I am receiving an error with this sql statement which works fine in Access. I insert a record then I need to get the ID of that record.

SELECT @@IDENTITY;

Description=[TCX][MyODBC]You have an error in your SQL syntax near
'@IDENTITY' at line 1

What type of change do I need to make this work?
 
For some reason running select last_insert_id() runs perfectly on my host server, but on my personal computer under localhost it only returns and id of 0.
Does anyone else have this problem? How can I correct this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top