Page 1 of 1

Getting an auto_inc ID back after insert

Posted: Wed Aug 04, 2004 5:11 pm
by turbo2ltr
Is there any way to get the auto_increment'ed ID back from an INSERT?

Assume that the ID may be the only unique field between records so running a SELECT on the inserted data may not return the newly inserted record.

Thanks,
Mike

Posted: Wed Aug 04, 2004 5:21 pm
by hawleyjr
[php_man]mysql_insert_id [/php_man]

Posted: Wed Aug 04, 2004 5:25 pm
by turbo2ltr
Thanks!