You need to clearly state why you want to insert multiple lines in a single statement. Is it for performance?
The framework is designed for performance and programming convenience, but not necessarily for performance. I agree with @Udi Mosayev's answer - use the infrastructure API in its simplest use.
If you are inserting a small number of rows, the difference between inserting one row from one operator and several rows per operator is not significant.
If you have a large number of rows, and you really need to insert them with high performance, nothing will be LOAD DATA INFILE . Your attempts to optimize the use of INSERT are cheap and pound-stupid. Even dropping your PHP array into tmpfile and then loading it with LOAD DATA faster than using INSERT .
source share