You need to be clear about your reason for wanting to insert multiple rows in a single statement. Is it for performance?
Frameworks are for programming productivity and convenience, but not necessarily performance. I agree with the answer given by @Udi Mosayev -- use the framework API in its simplest usage.
If you are inserting a small number of rows, the difference between inserting one row per statement and multiple rows per statement is insignificant.
If have a large number of rows and you really need them to insert with high-performance, nothing beats LOAD DATA INFILE. Your attempts to optimize usage of INSERT
are being penny-wise and pound-foolish. Even dumping your PHP array into a tmpfile and then loading it LOAD DATA
is faster than using INSERT
.