Re: running multiple updates on a single line
| From: | Ryan A | Date: | Tue, 04 Jul 2006 10:54:23 +0000 |
| Subject: | Re: running multiple updates on a single line | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239115@lists.php.net to get a copy of this message | ||
--- Chris <dmagick@gmail.com> wrote:
> Ryan A wrote:
> > Hi,
> > in phpmyadmin, in the SQL part where you can write
> a
> > query if I have a double update such as this:
> >
> >
> > it works without a problem as I am ending each sql
> > statement with a simicolon, but in my scripts when
> I
> > try to run multiple updates in a single line
> >
> > eg:
> > $xyz="update xyz set id=1 where id=0;update xyz
> set
> > id=3 where id=2;";
> >
> >
> > it does not work... any idea why?
-->Chris
> try a newline between the queries then phpmyadmin
> will see them as
> separate queries and run them properly.
@Chris,
Tried that... no joy.
-->João
> Could any of these lines cousing an error?
@João, nope, I broke them down to different
statements , put them into an array and ran them in a
for() loop and it works perfectly... problem is,
sometimes I have to run upto 15 updates at a time,
would be great if I can run that in one statement.
--> Robert
> RTFM :) -- mysql_query()
Ok, read it, again.... what am I missing?
I took out the semicolon from the end... then I get an
error.
I did find one user post saying that this runs just
one query at a time...but if thats the case how is
PHPMyAdmin running multiple statements that are
seperated by a semicolon?
Thanks!
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com