I have a table called Users that has the identifier called IdUser that is INT and AI.
I have another table called Subscription that has the foreign key called IdUser that is connected with the primary key of the table Users.
Now, the problem that I have is:
If when I insert a row in the table Users I would like to insert also a row in the subscription table, how can I do?
insert into users (nome, cognome, ...) values ('x', 'y', ...)
insert into subscription (...,IdUser) values (..., ????)
thanks in advance!
for mysql
see
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
for more info