paul bennett

MySQL multi insert

Posted on: October 29, 2007

I really wish I’d known this a long, long time ago:

insert into `mytable` (fname, lname, address) values ("john", "doe", "123 some st"), ("jane", "doe", "456 other st")

This wee gem allows an application to add multiple rows to a table in one simple query.

Say goodbye to those processor intensive loops…

Leave a comment

Archives