Syntax:
Object: BOOL mysqli::multi_query ( string $query
)
Process: bool mysqli_multi_query ( mysqli $link
, string $query
)
Usage:
< Span class= "Methodparam" >mysqli::multi_query ( string $query
)
$dataStr = ' Multiple SQL statements to execute '; $mysqli new mysqli (hostname,username,password,database); // connect to MySQL database if ($mysqli-connect_errno) { connect_error,printf$mysqli ); Exit ();} $mysqli->multi_query ($dataStr);
mysqli_multi_query ( mysqli $link
, < Span class= "type" >string $query
)
$dataStr = ' Multiple SQL statements to execute '; $link Mysqli_connect ("localhost", "My_user", "My_password", "World"); // connect to MySQL database if ($mysqli-connect_errno) { connect_error,printf$mysqli ); Exit ();} Mysqli_multi_query ($link,$dataStr );
Attention:
1. $DATASTR statement requires strict:
1), must be a pure SQL statement, cannot have comments
2), with ";" Execute SQL statement for interval, cannot have non ";" Other than the symbols, such as delimiter $$
2, the return value of the Multi_query () method, and the Mysqli property errno, error, info, and so on are only related to the first SQL command, and it is not possible to determine whether the second and subsequent commands are executing with an error. Therefore, when executing the return value of the Multi_query () method is true, it does not mean that subsequent commands do not have errors at execution time. That is, obviously the result of execution and the expected difference, but the return is true, no error
MySQL--mysqli::multi_query and Mysqli_multi_query