Skip to content

Commit

Permalink
Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Aug 10, 2022
1 parent 3a2c329 commit 173e94a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions examples/4-multi-rows.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
$future[] = async(fn () => $db->query("SELECT a * b FROM tmp"));
$future[] = async(fn () => $db->execute("SELECT POW(a, ?) AS power FROM tmp", [2]));

try {
/**
* @var MysqlResult $result1
* @var MysqlResult $result2
*/
[$result1, $result2] = Future\await($future); // Both queries execute simultaneously. Wait for both to finish here.
} catch (\Throwable $e) {
var_dump($e);
}
/**
* @var MysqlResult $result1
* @var MysqlResult $result2
*/
[$result1, $result2] = Future\await($future); // Both queries execute simultaneously. Wait for both to finish here.

print "Query 1 Results:" . PHP_EOL;
foreach ($result1 as $row) {
Expand Down

0 comments on commit 173e94a

Please sign in to comment.