Re: PHP Pear DB - Importing an external LAGRE .sql file
| From: | liran tal | Date: | Sat, 02 Aug 2008 21:50:26 +0000 |
| Subject: | Re: PHP Pear DB - Importing an external LAGRE .sql file | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29128@lists.php.net to get a copy of this message | ||
Hey Micah,
I don't think it's attempting to prevent the SQL injection. I think it's
more of an under-lying API restriction which
doesn't allow the processing of more than one INSERT at a time, but I could
be wrong.
Regards,
Liran.
On Sat, Aug 2, 2008 at 12:04 AM, Micah Gersten <micah@onshore.com> wrote:
> Most likely, it is escaping the semicolon to prevent SQL injection. You
> might want to use the shell to process a sql file.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> liran tal wrote:
> > I'm not sure but I think the error is that PEAR DB can't handle multiple
> > inserts or is it the database server (I'm using MySQL)
> > that can't handle it but in any case I have split my INSERTs using a
> known
> > suffix and then I use a loop to go over all the possible
> > INSERTs and perform this.
> >
> > Regarding the actual errors I received when trying to multiple INSERTs -
> the
> > error wasn't anything logical, it just said an SQL syntax
> > error. To see if I'm correct and this affects PEAR DB you can easily
> check
> > by running:
> >
> > $dbSocket->query("INSERT INTO table (a,b,c) VALUES
> > ('a','b','c');INSERT
> INTO
> > table (a,b,c) VALUES ('a','b','c');");
> >
> > This doesn't work for me so...
> >
> > Regards,
> > Liran.
> >
> >
> >
> > On Fri, Aug 1, 2008 at 5:27 PM, Mike D'Ambrogia <miked@jamagination.com
> >wrote:
> >
> >
> >> On 8/1/2008 8:20 AM, Mike D'Ambrogia wrote:
> >>
> >>
> >>> INSERT INTO /|tbl_name|/ (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
> >>>
> >>>
> >> those were supposed to be quotes... would have stripped them if I'da
> known
> >> that they would have ended up looking like that!
> >>
> >> should be:
> >> INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
> >>
> >>
> >> --
> >> PEAR General Mailing List (http://pear.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >
> >
>