我有一个表,根据 phpmyadmin 的行数约为 76.000 行(显示行 0 - 99(总共约 76,853 行,查询花费了 0.0322 秒))。然而,当尝试在 4950 个条目后从 phpmyadmin 浏览时,我得到空结果(没有显示任何内容)。
phpmyadmin 中的相关查询是:
SELECT * FROM mytable LIMIT 5000 , 100
如果我从 php 脚本运行此查询,它也会返回零行。
我也从 php 脚本运行这个
$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。
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";
这些查询还返回 4950 行...而不是 76.000
这是 InnoDB 表的常见问题解答。
请参阅说明https://phpmyadmin.readthedocs.org/en/latest/faq.html?highlight=MaxExactCount#the-number-of-rows-for-innodb-tables-is-not- Correct https://phpmyadmin.readthedocs.org/en/latest/faq.html?highlight=MaxExactCount#the-number-of-rows-for-innodb-tables-is-not-correct
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)