Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15711 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44192 invoked by uid 1010); 1 Apr 2005 08:13:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44176 invoked from network); 1 Apr 2005 08:13:22 -0000 Received: from unknown (HELO thieso.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2005 08:13:22 -0000 X-Host-Fingerprint: 151.189.21.48 mail-in-08.arcor-online.net Linux 2.5 (sometimes 2.4) (4) Received: from ([151.189.21.48:57540] helo=mail-in-08.arcor-online.net) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 0C/17-22409-0A20D424 for ; Fri, 01 Apr 2005 03:13:20 -0500 Received: from tc.ma.cx (dsl-084-059-192-171.arcor-ip.net [84.59.192.171]) by mail-in-08.arcor-online.net (Postfix) with ESMTP id 85C8D6A623; Fri, 1 Apr 2005 10:13:15 +0200 (CEST) Received: from localhost (schnuffel [127.0.0.1]) by tc.ma.cx (Postfix) with ESMTP id 03C3C8ABEB; Fri, 1 Apr 2005 10:13:16 +0200 (CEST) Received: from tc.ma.cx ([127.0.0.1]) by localhost (schnuffel.thieso.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31518-07; Fri, 1 Apr 2005 10:13:15 +0200 (CEST) Received: from [192.168.100.145] (unknown [62.206.42.140]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by tc.ma.cx (Postfix) with ESMTP id CDAC872D07; Fri, 1 Apr 2005 10:13:14 +0200 (CEST) In-Reply-To: <1383893714.20050331102838@marcus-boerger.de> References: <1383893714.20050331102838@marcus-boerger.de> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <1e14419686962a473412d07a3192ba41@thieso.net> Content-Transfer-Encoding: 7bit Cc: Thies C.Arntzen , internals@lists.php.net Date: Fri, 1 Apr 2005 10:13:10 +0200 To: Marcus Boerger X-Mailer: Apple Mail (2.619.2) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at thieso.net Subject: Re: [PHP-DEV] pdo: binding variables supplied to execute() is NotVeryUseful(tm)... From: thies@thieso.net (Thies C . Arntzen) Am 31.03.2005 um 17:28 schrieb Marcus Boerger: > Hello Thies, > > Friday, March 25, 2005, 1:55:30 PM, you wrote: > >> and this is 'cause pdo _expects_ the user to prefix the bound >> variables >> with a colon. grr... > >> ppls, lets change it before it's too late. this "tiny bit" makes >> binding >> harder than it should be, and we all know and understand that all user >> of php should use bound variables all the time! > >> suggestion: auto-trim a leading colon from the internal binding >> tables. >> that way "oldish" code would not break... > > >> re, thies > >> PS: looking into that right now - hopefully "patch follows";-) > > > We could easily add this behavior and i think it makes somewhat sense. > It just looks a bit like __wakepup/__sleep. The only 'but' is that i > suggest the behavior has its own method like 'bindParamArray'. If you > cannot work out a patch feel free to contact me. Maybe i'll find some > time during the conf. hey marcus! i don't quite understand the relation to sleep/wakeup here (i'm not reading all the php lists, maybe you could point me to the right thread?) adding a new 'bindParamArray' with different semantics doesn't really make things easier. and i think we should have once consistent parameter-bind interface: - a method bindParam - an optinal associative array passed to execute. all those functions expect to bind a to a statement. this should work both with or without a leading colon. by the way (just checked) - this is how the "native" oracle-oci binding functions work. so oracle decided to make the colon in front of the placeholder for bind optional. at the end of the day you can only bind to a placeholder defined in your sql-statement. in the sql you have to "mark" the placeholder by prepending a colon - but for the bind you really don't need the colon. really! so - again - lets make the colon *optional* - everywhere we allow binding in PDO! re, thies