phpmyadmin:MySQL的表行数不正确 [英] phpmyadmin: Incorrect table rowcount with MySQL
问题描述
我有一张表,根据phpmyadmin的行数大约为76.000行(显示第0-99行(总计〜76,853行,查询用时0.0322秒)和).但是,当尝试在4950个条目之后从phpmyadmin浏览时,我得到空结果(未显示任何内容).
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 ).
phpmyadmin中的相关查询为:
the relevant query in phpmyadmin is:
SELECT * FROM mytable LIMIT 5000 , 100
如果我从php脚本运行此查询,该查询还将返回零行.
this query returns also zero rows if i run it from a php script.
我也从php脚本中运行了此
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>";
结果为4950行.
我做错什么了吗?
引擎是innoDB.
修改
$nRows = (int) $LGCACHEPDO->query("select count(*) from mytable")->fetchColumn();
echo $nRows;
和
$q = $LGCACHEPDO->query("select * from mytable");
$rows = $q->fetchAll();
$rowCount = count($rows);
echo "There are $rowCount rows\n";
这些查询还返回4950行...而不是76.000
these queries ALSO return 4950 rows... instead of 76.000
推荐答案
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
这篇关于phpmyadmin:MySQL的表行数不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!