Re: PDO statement execute enhancement

From: Date: Wed, 09 Aug 2006 08:34:04 +0000
Subject: Re: PDO statement execute enhancement
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-25255@lists.php.net to get a copy of this message
On Wed, 9 Aug 2006, Marian Kostadinov wrote: > I have a suggestion that is related a little to my bug report #38394 ( > http://bugs.php.net/bug.php?id=38394). > > It's about the execution of a prepared statement. > Let's say we have a prepared statement for > > UPDATE table SET field1 = :field1, field2 = :field3 WHERE id = :id > > in order to execute it we have something like this: > $data = array ('id' => 3, 'field1' => 'value1', > 'field2' => 'value2'); > $stmt->execute ($data); > > But I think that it is so common to have things like this > $data = array ('id' => 3, 'field1' => 'value1', > 'field2' => 'value2', > 'field3' => 'value3', 'field4' => 'value4'); > $stmt->execute ($data); > > But that is not executed because we have some additional key/value pairs. > So the idea is to allow this. Also I suggest we allow using object along > with an array. This is a common situation also. Actually, it is dependent on the driver what happens here, which is not at all documented either. However, it would be nice if this indeed would work. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

« previous php.internals (#25255) next »