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 <parameter name> to a statement. this <parameter name> 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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to