Insert and Return

admin

Administrator
Staff member
I am trying to insert a record into my database and I want it to return the id number for the record it just returned. Is there any way to have mysql to and insert and return command.

Example:

$query = "INSERT INTO contacts VALUES (values go here);"

mysql_$query($query);

Now I want to know if I could modify that to tell me what the id number for that new record is. I need to build another query right after that. The second query requires the id number created in the first query.

Thanks,
Daniel Ice

<!-- w --><a class="postlink" href="http://www.coderguy.com">www.coderguy.com</a><!-- w -->
 
Back
Top