Possible Duplicate:
The equivalent of SQLServer function SCOPE_IDENTITY() in mySQL?
i have created data entry form in my web application using codeigniter. In my database, i have two table, for example table A and B.
Example of the table structure
A ( id_a, name, sex, id_b ) B ( id_b, address, hobby, school )
I set autoincrement for id_a and id_b,, the values for table A and B is getting from the data entry form after submitted by user in my web application.
After user submit the form, first table B will be insert and next table A also insert. How to set the id_b in table A using the value of id_b in table B automatically same when user submit the form, so i can use the id_b as the foreign key. Thank you.