PHP asynchronous mysql-query -


my app first queries 2 large sets of data, work on first set of data, , "uses" on second.

if possible i'd instead query first set synchronously , second asynchronously, work on first set , wait query of second set finish if hasn't , use first set of data on it.

is possible somehow?

it's possible.

$mysqli->query($long_running_sql, mysqli_async);  echo 'run other stuff';  $result = $mysqli->reap_async_query(); //gives result (and blocks script if query not done) $resultarray = $result->fetch_assoc(); 

or can use mysqli_poll if don't want have blocking call

http://php.net/manual/en/mysqli.poll.php


Comments

Popular posts from this blog

Prolog - Listing -

orchardcms - change base url in local copy in Orchard CMS -

linear regression - Trying to get confidence/prediction intervals with `predict.lm` in R, but I keep getting an error regarding my dichotomous variable -