phpmyadmin: Incorrect table rowcount with MySQL

2019-07-13 05:05发布

I have a table which row count according to phpmyadmin is about 76.000 rows ( Showing rows 0 - 99 ( ~76,853 total , Query took 0.0322 sec) and the ). However when try to browse from phpmyadmin after 4950 entries ) i get null results ( nothing displayed ).

the relevant query in phpmyadmin is:

SELECT * FROM mytable LIMIT 5000 , 100

this query returns also zero rows if i run it from a php script.

i also ran this from a php script

$getcache_PRST = $LGCACHEPDO->prepare("SELECT * FROM mytable");
$getcache_PRST->execute() or die($LGCACHEPDO->errorInfo());
$getcache_ROWN = $getcache_PRST->rowCount();

echo $getcache_ROWN ."<br>";

and the result is 4950 rows.

am i doing something terribly wrong ?

the engine is innoDB.

edit

$nRows = (int) $LGCACHEPDO->query("select count(*) from mytable")->fetchColumn(); 
echo $nRows;

and

$q = $LGCACHEPDO->query("select * from mytable");
$rows = $q->fetchAll();
$rowCount = count($rows);
echo "There are $rowCount rows\n";

these queries ALSO return 4950 rows... instead of 76.000

2条回答
成全新的幸福
2楼-- · 2019-07-13 05:24

I downloaded the table and indeed as you guys mentioned the report by phpmyadmin is not exact. the row count is indeed 4950 rows. thanks.

查看更多
登录 后发表回答