fetch() returning false for empty datasets
| From: | Lukas Smith | Date: | Mon, 05 Jun 2006 09:41:12 +0000 |
| Subject: | fetch() returning false for empty datasets | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-3845@lists.php.net to get a copy of this message | ||
Hi,
the following script outputs "false" (at least on whatever pdo version is bundled with 5.1.4):
$sql = 'SELECT 1 FROM dual WHERE 1=0';
$stmt = $dbh->query($sql);
var_dump($stmt->fetch(PDO::FETCH_ASSOC));
all other RDBMS extension we have return null in this case, which seems to be the right thing too ..
regards,
Lukas