Currently, I am using prepared statements to insert a bunch of rows with underneath code:
UPDATED CODE:
$sql = $mysqli->prepare("INSERT INTO `TBLName` (Col1, Col2, Col3) Values(?, ?, ?)");
for ($i = 0; $i < 1000; $i++) {
$sql->bind_param('sss', $Col1Data, $Col2Data, $Col3Data);
$sql->execute();
}
$sql->close();
However, I have seen an article talking about Transaction being way faster... Could I use transaction in combination with the prepared statement or should I use it in a different way? Suppose that I have to insert 1000 rows per script run and the script get's triggered with an interval of 5 seconds, what is the best way to go for me?