On Tue, Feb 24, 2009 at 8:53 PM, PJ af.gour...@videotron.ca wrote:
Is there a way to insert several rows into a table with one statement?
I have this:
$sql2 = INSERT INTO authors
(first_name, last_name, ordinal) VALUES
('$first_nameIN', '$last_nameIN', '1');
After doing an INSERT, you may do
SELECT last_insert_id();
and it will return the last id the last INSERT command used. it doesn't matter if your
MySQL server is very busy doing inserts, if
you call 'SELECT last_insert_id()' right after the INSERT, you will get the correct
value.