Hướng dẫn multi_query in php
mysqli_multi_query(PHP 5, PHP 7, PHP 8) mysqli::multi_query -- mysqli_multi_query — Performs one or more queries on the database DescriptionObject-oriented style public mysqli::multi_query(string mysqli_multi_query(mysqli Queries are sent asynchronously in a single call to the database, but the database processes them sequentially. mysqli_multi_query() waits for the first query to complete before returning control to PHP. The MySQL server will then process the next query in the sequence. Once the next result is ready, MySQL will wait for the next execution of mysqli_next_result() from PHP. It is recommended to use do-while to process multiple queries. The connection will be busy until all queries have completed and their results are fetched to PHP. No other statement can be issued on the same connection until all queries are processed. To proceed to the next query in the sequence, use mysqli_next_result(). If the next result is not ready yet, mysqli will wait for the response from the MySQL server. To check if there are more results, use mysqli_more_results(). For queries which produce a result set,
such as Tip Executing
Parametersmysql Procedural style only: A mysqli object returned by mysqli_connect() or mysqli_init() query A string containing the queries to be executed. Multiple queries must be separated by a semicolon. Return Values Returns ExamplesExample #1 mysqli::multi_query() example Object-oriented style
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); Procedural style
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); The above examples will output something similar to: my_user@localhost ----------------- Amersfoort Maastricht Dordrecht Leiden Haarlemmermeer See Also
jcn50 ¶ 11 years ago
Ivan Gabriele ¶ 8 years ago
miqrogroove at gmail dot com ¶ 9 years ago
info at ff dot net ¶ 16 years ago
mysqli_more_results($this->sqlLink)) mjmendoza at grupzero dot tk ¶ 15 years ago
vicky dot gonsalves at outlook dot com ¶ 8 years ago
skunkbad ¶ 8 years ago
$this->mysqli->errno ) Lubaev K ¶ 9 years ago
crmccar at gmail dot com ¶ 10 years ago
keksov at gmail dot com ¶ 9 years ago
Anonymous ¶ 11 years ago
jlong at carouselchecks dot com ¶ 10 years ago
Shawn Pyle ¶ 12 years ago
ashteroid ¶ 2 years ago
Stjepan Brbot ¶ 6 years ago
=new mysqli(...);$sql="CALL proc1(...); CALL proc2(...);";$procs=[]; //outer array for resultsets (tables) luka8088 at owave dot net ¶ 12 years ago
jparedes at gmail dot com ¶ 14 years ago
Miles ¶ 13 years ago
undefined(AT)users(DOT)berlios(DOT)de ¶ 14 years ago
= mysqli_connect( "localhost", "owner", "pass", "db", 3306, "/var/lib/mysql/mysql.sock" );
$QUERY = << ASchmidt at Anamera dot net ¶ 4 years ago
levani0101 at yahoo dot com ¶ 8 years ago
jesper at hermandsen dot dk ¶ 7 years ago
|