I'm wondering if prepared statements work the same as a normal mysql_query with multiple VALUES.
INSERT INTO table (a,b) VALUES ('a','b'), ('c','d');
VS
$sql = $db->prepare('INSERT INTO table (a,b) VALUES (?, ?);
If I use the prepared statement in a loop, is MySQL optimizing the insert in the background to work like it would in the first piece of code there, or is it just like running the first piece of code inside a loop with one value each time ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…