Re: cvs: php4 /pear/DB common.php
| From: | Stig S. Bakken | Date: | Tue, 04 Dec 2001 12:44:37 +0000 |
| Subject: | Re: cvs: php4 /pear/DB common.php | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-1465@lists.php.net to get a copy of this message | ||
"Tomas V.V.Cox" wrote:
>
> "Stig S. Bakken" wrote:
> >
> > Actually, why can't DB_common::query just accept an optional second
> > parameter? If the parameter is an array, the query is prepared and
> > executed with the second parameter as execute data?
> >
>
> But it would mean to depreciate execute() and by the way if the first
> arg of data is an array it could act as excuteMultiple(). Or is there a
> reason not to "execute" a query immediatly after a prepare?
Yes, in most (or all) of the databases supporting placeholders/binding,
the parsed and optimized query is cached. Re-using this pre-parsed
query gives a nice performance gain for example when doing a large
number of inserts or updates with the same query, just different data.
> Well, for the moment I'll drop executeQuery() and use query() instead.
Good :-)
- Stig