The documentation of mysqli_multi_query
and mysqli_query
doesn't say if calling mysqli_multi_query
is the same as calling mysqli_query
multiple times.
Does anyone know the answer?
The documentation of mysqli_multi_query
and mysqli_query
doesn't say if calling mysqli_multi_query
is the same as calling mysqli_query
multiple times.
Does anyone know the answer?
No. mysqli_multi_query is asynchronous, it will send all queries to a database server but return only the first result immediately. Therefore to check the result of all other queries you will need some additional code. Whereas to run a set of mysql_query() you dont't need any additional code, but just use the every query's result right away.
That said, both functions have a very limited use. The only application for mysqli_multi_query is to run some pre-written sql dumps. mysql_query() has a very limited use too, as there are not so much queries that do not accept variable data. And for such queries you must use mysqli_prepare() instead.