Re: auto_increment in multiple tables...

2002-11-02 Thread Bhavin Vyas
IL PROTECTED]> Sent: Saturday, November 02, 2002 3:09 PM Subject: auto_increment in multiple tables... > > Hello list, > > I have two tables, USER and STUDENT, where all students are users. The > user table has an auto-increment key field. I want to make an operation > to insert

Re: auto_increment in multiple tables...

2002-11-02 Thread Walter Lee Davis
Are you using PHP? There is a useful function in there that would give you the last auto-number, like this: (do your first insert) $insert_key = mysql_insert_id(); (do your second insert, using $insert_key as the new foreign key that you are putting in your SQL) Now each table has its own auto-

auto_increment in multiple tables...

2002-11-02 Thread João Borsoi
Hello list, I have two tables, USER and STUDENT, where all students are users. The user table has an auto-increment key field. I want to make an operation to insert users, which should insert rows in both tables (see the tables bellow). How can I control the auto_increment field in both tables? D

auto_increment in multiple tables...

2002-11-02 Thread João Borsoi
Hello list, I have two tables, USER and STUDENT, where all students are users. The user table has an auto-increment key field. I want to make an operation to insert users, which should insert rows in both tables (see the tables bellow). How can I control the auto_increment field in both tables?