Reputation: 534
I'd like to know if it's possible to execute a mysql query, and not wait for result. Explanation : i have an insert query in a php page, which take some time, but it's not necessary for the page display to wait that it's complete. It's statistics, so even if it failed, it's not important. I tried to use MYSQLI_ASYNC, but then, the very next request gets this error message :
Array
(
[code] => 2014
[message] => Commands out of sync; you can't run this command now
)
Any idea ? Thanks.
Upvotes: 2
Views: 2047
Reputation: 534
It seems like i found what i needed :
Initial insert time : 90-120ms New insert time : 1-2ms
Yessss !!!
Upvotes: 2
Reputation: 99525
You can let a MySQL query run asynchronously, but you can't send a second mysql query over the wire before handling the first.
https://secure.php.net/manual/en/mysqli.reap-async-query.php
Upvotes: 1