Here's what I'm trying:
if($mysqli->multi_query(file_get_contents('file_that_contains_a_bunch_of.sql'))) {
do {
$result = $mysqli->use_result();
if($mysqli->errno === 0) {
echo $mysqli->affected_rows.' row(s) affected'.PHP_EOL;
} else {
die($mysqli->error);
}
} while($mysqli->next_result());
}
But it's aborting the loop early and doesn't print an error message. How do I find out what the error is?