Re: DB batch queries
| From: | Matthew Weier O'Phinney | Date: | Tue, 02 Nov 2004 03:11:16 +0000 |
| Subject: | Re: DB batch queries | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15289@lists.php.net to get a copy of this message | ||
* Aidan Lister <aidan@php.net>:
> When I say batch, I just mean more than one query. Unfortunately they
> are all different, so prepared queries are not appropriate.
Ah, well that takes away one option.
I'm not sure about the sqlite API -- I haven't had much need or desire
to try out sqlite yet. The mysql API is such that you can only execute a
single SQL statement at a time (though if you're brave and have the 4.1
series of MySQL -- or higher -- the mysqli API has a multi_query()
method that allows many).
You might consider writing a parser that would split queries on
semicolons placed outside quotes and put each query into an element of
an array; then you could loop over that array and execute each query.
--
Matthew Weier O'Phinney | mailto:matthew@garden.org
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org