Hi guys is it possible for me to write a statment that will insert a new record into a DB and return its 'id' value. Assuming the id column is set to auto increment.
Many thanks for any help ;]
Jim
Hi guys is it possible for me to write a statment that will insert a new record into a DB and return its 'id' value. Assuming the id column is set to auto increment.
Many thanks for any help ;]
Jim
Yep. Insert it without using the autoincremented value and then use [man]mysql_insert_id[/man] to get the autogenerated id.
OK cool thanks alot - just browsing the php manual looks like the function is designed for working with auto increment columns - ill have a play..... thanks again ;]
cheers - incorporated it into my db abstraction layer - works like a dream ;]