views:

131

answers:

1

Java has the PreparedStatement addBatch + executeBatch to do multiple insertions efficiently.

What is the fasted way to do a batch of inserts using php's mysqli extension?

Thanks!

+1  A: 

MySQL natively supports multiple insertions with one query.

INSERT INTO [Table] ([Column List])
VALUES ([Value List 1])
     , ([Value List 2])
       [...]
     , ([Value List N])
Peter Bailey