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
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-
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
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?