[SOLVED] Getting an auto_inc ID back after insert

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
turbo2ltr
Forum Commoner
Posts: 29
Joined: Sun Jul 18, 2004 4:08 pm

Getting an auto_inc ID back after insert

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

[php_man]mysql_insert_id [/php_man]
turbo2ltr
Forum Commoner
Posts: 29
Joined: Sun Jul 18, 2004 4:08 pm

Post by turbo2ltr »

Thanks!
Post Reply