Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24034 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42068 invoked by uid 1010); 9 Jun 2006 12:24:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42047 invoked from network); 9 Jun 2006 12:24:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2006 12:24:20 -0000 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 66.249.92.173 ug-out-1314.google.com Linux 2.4/2.6 Received: from ([66.249.92.173:22426] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 27/15-30619-27869844 for ; Fri, 09 Jun 2006 08:24:19 -0400 Received: by ug-out-1314.google.com with SMTP id u2so1376290uge for ; Fri, 09 Jun 2006 05:24:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AYm8ehZYIgC2BuKBszL6Uha/FLcGnNhmdFVOprmv52a0UvvMQJhyhuSdjoega/2nhGK742gxO8bDTJ/QoIiJXJegZecRUU38OnLK86tkl/3Fmzg47JsBmf6vh3yTm9RqtnOu4RdyFKKySApXJaV1x59gZjSc/i5088kUrTrwVHU= Received: by 10.67.89.5 with SMTP id r5mr2462018ugl; Fri, 09 Jun 2006 05:24:13 -0700 (PDT) Received: by 10.66.220.11 with HTTP; Fri, 9 Jun 2006 05:24:13 -0700 (PDT) Message-ID: Date: Fri, 9 Jun 2006 14:24:13 +0200 To: "Lukas Smith" Cc: "PHP Developers Mailing List" In-Reply-To: <448967F6.4040003@php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <448967F6.4040003@php.net> Subject: Re: [PHP-DEV] [Fwd: fetch() returning false for empty datasets] From: pierre.php@gmail.com (Pierre) On 6/9/06, Lukas Smith wrote: > 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 .. I have to agree here. NULL defines this situation perfectly, false being used for errors (strict false, === FALSE). --Pierre