phpmyadmin: Incorrect table rowcount with MySQL

半世苍凉 提交于 2020-01-04 06:40:06

问题


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


回答1:


This is a FAQ for InnoDB tables. See the explanation at https://phpmyadmin.readthedocs.org/en/latest/faq.html?highlight=MaxExactCount#the-number-of-rows-for-innodb-tables-is-not-correct




回答2:


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.



来源:https://stackoverflow.com/questions/18607675/phpmyadmin-incorrect-table-rowcount-with-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!