Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 30, 2018
1 parent e4b65f0 commit 3b7013d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/2-simple-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'support/bootstrap.php';

use Amp\Mysql;
use Amp\Sql\ResultSet;

Amp\Loop::run(function () {
$db = Mysql\pool(Mysql\ConnectionConfig::fromString("host=".DB_HOST.";user=".DB_USER.";pass=".DB_PASS.";db=".DB_NAME));
Expand All @@ -12,8 +11,8 @@
$result = yield $db->query("SELECT 1 AS value");

while (yield $result->advance()) {
$row = $result->getCurrent(ResultSet::FETCH_ARRAY);
\var_dump($row[0]);
$row = $result->getCurrent();
\var_dump($row['value']);
}

$db->close();
Expand Down

0 comments on commit 3b7013d

Please sign in to comment.