Page 1 of 1

MySQL inserting row + rows at a time in to two tables probs

Posted: Tue Mar 01, 2005 7:21 am
by harsha
I have two tables

Submission

and file_info


when I insert a row in to the Submission Table a sub_id is generated automatically and as soon as I insert a row

I am trying to insert some rows in to file_info which Has a column called sub_id

and I have difficulty in getting the sub_id as soon as the row is inserted so that I can use that in the file_info table

is there any thing called as Select sub_id on inserting the row Blah blah..

Posted: Tue Mar 01, 2005 7:27 am
by n00b Saibot
assuming your sub_id column is an auto_increment field, you can get the so generated sub_id by calling function mysql_insert_id()