Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15573 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72896 invoked by uid 1010); 24 Mar 2005 11:32:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 72881 invoked from network); 24 Mar 2005 11:32:34 -0000 Received: from unknown (HELO mailserverfree01.dynip.com) (127.0.0.1) by localhost with SMTP; 24 Mar 2005 11:32:34 -0000 X-Host-Fingerprint: 212.250.162.15 smtpout15.mailhost.ntl.com Solaris 8 (1) Received: from ([212.250.162.15:47119] helo=mta05-winn.mailhost.ntl.com) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 5C/10-02157-155A2424 for ; Thu, 24 Mar 2005 06:32:34 -0500 Received: from aamta07-winn.mailhost.ntl.com ([212.250.162.8]) by mta05-winn.mailhost.ntl.com with ESMTP id <20050324113226.MGRN12099.mta05-winn.mailhost.ntl.com@aamta07-winn.mailhost.ntl.com>; Thu, 24 Mar 2005 11:32:26 +0000 Received: from win2ks ([213.107.8.99]) by aamta07-winn.mailhost.ntl.com with ESMTP id <20050324113223.HNKP10174.aamta07-winn.mailhost.ntl.com@win2ks>; Thu, 24 Mar 2005 11:32:23 +0000 Reply-To: To: "'Thies C. Arntzen'" , Date: Thu, 24 Mar 2005 11:32:40 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcUwY7Bw1Kx6lfB8S5yCnStBNKItGQAAQPJA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 In-Reply-To: Message-ID: <20050324113223.HNKP10174.aamta07-winn.mailhost.ntl.com@win2ks> Subject: RE: [PHP-DEV] pdo: cannot send NULL values thru bound parameters. From: jared.williams1@ntlworld.com ("Jared Williams") References: > $stmt = $this->prepareStatement('insert into bla (name) > values (:name)'); $name = NULL; var_dump($name); // $name is > NULL $stmt->bindParam(':name', $name); var_dump($name); // > $name is an empty string > > am i overlooking something obvious? $stmt->bindParam(':name', $name, PDO_PARAM_NULL); Or $stmt->bindParam(':name', $name, is_null($name) ? PDO_PARAM_NULL : PDO_PARAM_STR); Is what I've been using, and works. http://pecl.php.net/bugs/bug.php?id=3391 was the original bug report I opened, that's since been fixed. Jared