I want to get the last inserted ID when i insert the new data into the database help me with msql query
Hi kishore21,
If your ID is AutoIncrement Column. call LAST_INSERT_ID() function immediately after insertion.
SELECT LAST_INSERT_ID();
While inserting the record are you inserting the ID serially or randomly?
If you are inserting serially then use MAX() function.
SELECT MAX(ID) FROM TableName
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.