amphp\mysql not returning all the records
decodingram opened this issue · 2 comments
Hi,
Since I raised this concern in stack overflow as well but couldn't find the answer, I have put it here: https://stackoverflow.com/questions/52058338/amphp-mysql-not-returning-all-the-records
We have started using amphp\mysql to run pool of connections for threading concept. We have a table "content" which has 100k of records. Trying to list out for further processing but fetching only 42 records. Also, doesn't have any LIMIT statement.
What am I missing in my code?
Below is the code:
require "vendor/autoload.php";
use Amp\Loop;
use Amp\Artax\Request;
use Amp\Artax\Response;
$db = '';
Amp\Loop::run(function () {
$client = new Amp\Artax\DefaultClient;
$db = Amp\Mysql\pool("host=".$this->conn_prop['db_host']."; user=".$this->conn_prop['db_user']."; pass=".$this->conn_prop['db_passwd']."; db=".$this->conn_prop['db_name']);
$statement = (yield $db->query("SELECT registration_id,w_id,ip,device_type FROM content WHERE active_status='1' AND ip !=''"));
$cnt = 0;
while (yield $statement->advance()) {
echo $cnt++;
$row = $statement->getCurrent();
if(!empty($row)){
var_dump($row);
.................
................
}
}
});
Waiting for the suggestion.
Could you please try the master branch and report back; I recently encountered a similar problem, which isn't fixed in the latest release, but is in master.
Please upgrade to v1.0.0
and reopen this issue if the problem persists.