Hi- I would like to run an insert query across two tables at the same time. The first table has a primary key that is auto_increment, the second table needs to insert the primary key from the first table as a reference?
How do I auto-populate the tableId field with the correct entry from the first table insert? Thanks in advance, Max insert into table1 (name, desc) values ("foo", "foouser"); id name desc 55 foo foouser insert into table2 (table1Id, text) values ("?", "some text"); id table1Id text 69 55 some text --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php