On 3/22/07, Rick <[EMAIL PROTECTED]> wrote:


>
> * DB had a nice autoExecute(), but its counterpart in MDB2 requires
> you to tell it the datatype of each parameter. If I intend to use
> MySQL and not planning to support other backends (except maybe
> something like SQLite), is there any reason not to lie to it and say
> that everything is 'text'?  My motivation is Laziness, shorter code,
> less hard-coded SQL, e.g.:
Laziness is a great motivator in many cases; this is quite possibly the
worst though.  If you are trying to "work around" prepared queries, then
don't use them.  Otherwise, use them right. :p  So yes, there's plenty
of reasons not to lie to it and say everything is 'text,' especially if
everything _isn't_ text.


Thanks for the input. I got nothing against prepared queries at all. I was
simply thinking it's nice not to have to examine every key=>value pair in
the $this->data of my example, and figure out the data type of each value.
And since MySQL lets you quote numeric data types....

I got spoiled by my old friend DB's autoExecute()

--
David Mintz
http://davidmintz.org/

En Nueva York el tránsito de la belleza a la desolación sucede siempre
expeditivamente, como si el principio universal de máxima eficiencia hubiera
aconsejado la supresión de gradaciones intermedias.

 -- Antonio Muñoz Molina, Ventanas de Manhattan
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to