· 7 years ago · Jan 12, 2019, 09:40 PM
1What is the maximum number of queries in a multi query?
2$conn = new mysqli($db_hostname, $db_username, $db_password);
3 if (mysqli_connect_errno()) {
4 exit('Connect failed: '. mysqli_connect_error());
5 }
6
7 $sql = "CREATE TABLE IF NOT EXISTS......";
8 $sql .= "CREATE TABLE IF NOT EXISTS......";
9 $sql .= "CREATE TABLE IF NOT EXISTS......";
10 $sql .= "INSERT ......";
11 $sql .= "INSERT ......";
12 <and so on>
13 mysqli_autocommit($conn, false);
14 mysqli_multi_query($conn, $sql);
15 mysqli_rollback($conn);