I have a simple user table, which has 2 fields: id and name. id is an auto increment (so it is unique) int type.
I want to insert a record to this table and obtain the id of this new record.
The problem is that once I inserted a record, I cannot find this record because name is not a unique type.
$insert="insert into user set name='$name'";
mysql_query($insert) or die(mysql_error());
//how to obtain the id of this newly inserted record?