2

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

gia
  • 757
  • 5
  • 19
MirrorMirror
  • 186
  • 8
  • 36
  • 70
  • please see http://php.net/manual/en/pdostatement.rowcount.php –  Sep 04 '13 at 07:20
  • possible duplicate of [Why does my InnoDB table have a weird value for record count?](http://stackoverflow.com/questions/1252008/why-does-my-innodb-table-have-a-weird-value-for-record-count) – deceze Sep 04 '13 at 07:30
  • Probably, that's what `about` and `~` imply. – Álvaro González Sep 04 '13 at 07:48
  • possible duplicate of [Why estimated rows count is very different in phpmyadmin result?](http://stackoverflow.com/questions/11926259/why-estimated-rows-count-is-very-different-in-phpmyadmin-result) – Álvaro González Sep 04 '13 at 07:53

2 Answers2

3

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

Marc Delisle
  • 8,879
  • 3
  • 29
  • 29
0

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.

MirrorMirror
  • 186
  • 8
  • 36
  • 70