note 77769 rejected from function.PDOStatement-rowCount by nlopess

From: Date: Wed, 12 Sep 2007 19:10:33 +0000
Subject: note 77769 rejected from function.PDOStatement-rowCount by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-130427@lists.php.net to get a copy of this message
Note Submitter: miha dot wagner at gmail dot com ---- I have tried this example: <?php $sql = $pdo->prepare("SELECT * FROM foo WHERE bar=1"); $sql->execute(); echo "There are " .count($sql->fetchAll()) ." rows where bar=1"; ?> I am just wondering. Is this a valid way of counting rows from a SELECT statement? Thanks!

« previous php.notes (#130427) next »