getting the value of auto_increment field

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
sarris
Forum Contributor
Posts: 137
Joined: Mon Dec 04, 2006 2:44 pm

getting the value of auto_increment field

Post by sarris »

Hi there,
I am adding an entry into a table, in the traditional way (forming a $sql variable to contain the querry, then mysql_query()), and this table contains a field named "id" that is auto_increment. My question is if there is a way to obtain the value "id" of the newly inserted element...
Thank you for anything you can do
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

sarris
Forum Contributor
Posts: 137
Joined: Mon Dec 04, 2006 2:44 pm

Post by sarris »

thank you very much
Post Reply