mysqli_multi_query
mysqli->multi_query()
Performs a query on the database
&reftitle.description;
Procedural style:
boolmysqli_multi_query
mysqlilink
stringquery
Object oriented style (method):
mysqli
boolmulti_query
stringquery
Executes one or multiple queries which are concatenated by a semicolon.
To retrieve the resultset from the first query you can use
mysqli_use_result or mysqli_store_result.
All subsequent query results can be processed using
mysqli_more_results and mysqli_next_result.
&reftitle.parameters;
&mysqli.link.description;
query
The query, as a string.
&reftitle.returnvalues;
Returns &false; if the first statement failed.
To retrieve subsequent errors from other statements you have to call
mysqli_next_result first.
&reftitle.examples;
Object oriented style
multi_query($query)) {
do {
/* store first result set */
if ($result = $mysqli->store_result()) {
while ($row = $result->fetch_row()) {
printf("%s\n", $row[0]);
}
$result->close();
}
/* print divider */
if ($mysqli->more_results()) {
printf("-----------------\n");
}
} while ($mysqli->next_result());
}
/* close connection */
$mysqli->close();
?>
]]>
Procedural style
]]>
&example.outputs;
&reftitle.seealso;
mysqli_use_result
mysqli_store_result
mysqli_next_result
mysqli_more_results