Possible Duplicate:
Is there a way to return the id of a row that was just created in MySQL with PHP?
hi, i have an inset command such as
insert (name) values($name);
where i have id column as outoincrement how can i get the id of the inserted record after inserting directly
If you are working with
mysql_*function, you’ll have to usemysql_insert_id()(quoting) :With mysqli, you’ll use
mysqli::insert_id().And, with PDO, you’ll call
PDO::lastInsertId().