amphp / mysql

An async MySQL client for PHP, optimizing database interactions with efficient non-blocking capabilities. Perfect for responsive, high-performance applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different query result under transaction

xpader opened this issue · comments

commented

In transaction example use execute() to do a query and get result, not query():

$result = yield $transaction->execute("SELECT * FROM tmp WHERE a >= ?", [5]); // Two rows should be returned.
while (yield $result->advance()) {
\var_dump($result->getCurrent());
}

When change to query() I get this error:

Error: Call to undefined method Amp\Mysql\Internal\ResultProxy::advance()

I found that execute() return Amp\Mysql\PooledResultSet, but query() return Amp\Mysql\Internal\ResultProxy.

But in non-transaction query, the query() and execute() always return 'Amp\Mysql\PooledResultSet`.

Is that a problem?