"Michael Hanney" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am ditching my own DB abstraction class in favour of MDB2.
> When I need to do a sinlge INSERT, should I use
MDB2_Driver_Common->prepare
> like this..
>     $prep = $this->mdb2->prepare('INSERT INTO test (test_id, name) values
> (?,?)', $types);
>     $result = $this->mdb2->executeParams($prep, $types, $data);
> OR should I simply use MDB2_Driver_Common->query($sql)..
>     $res = $this->mdb2->query($sql);
> where the $sql contains the pre-formatted INSERT statement? What I really
> want to know is - does the prepare method offer any compatibility
advantage
> (escaping depending on types?),
> or is it just for speeding up multiple inserts i.e. prepare once, execute
> many. The docs explain how, but not always why. Inserts don't happen very
> often in my apps so compatibility accross multiple dbs is more important
to
> me than speed. Finally, is this the right place to ask questions about
MDB2,
> or is there a more specific group for discussing Pear projects?
>

Please send your question to the PEAR mailing list php.pear.general

Regards, Torsten Roehr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to