Possible Duplicate:
PHP/MySQL: Retrieving the last Inserted Ids for multiple rows
Mysql table columns ( ID, name) id- auto increment.
I will retrieve the last inserted id by...
DECLARE value VARCHAR(30);
insert into table (name) values ('foo');
select max(id) into value from table;
This is how i m retrieving the max of id.
What happens if multiple insert statements triggers at same time. Whats the best practice to do this.
1) Locking the Mysql table
2) add one more column and set it to '0' or '1' technique.
3) Any other ways to do this.
Am using MySql and c# .Net Thanks