[Fwd: fetch() returning false for empty datasets]
| From: | Lukas Smith | Date: | Fri, 09 Jun 2006 12:22:14 +0000 |
| Subject: | [Fwd: fetch() returning false for empty datasets] | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-24033@lists.php.net to get a copy of this message | ||
Forwarding here.
Maybe it got lost inbetween the spam attacks, maybe its just not interesting but lets open up the topic to a larger audience :)
-------- Original Message --------
Subject: fetch() returning false for empty datasets
Date: Mon, 05 Jun 2006 11:41:12 +0200
From: lsmith@php.net (Lukas Smith)
To: pecl-dev@lists.php.net
Newsgroups: php.pecl.dev
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