Re: running multiple updates on a single line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan A wrote:


--- Chris <dmagick@xxxxxxxxx> 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
because it manually splits them on the semicolon and runs each one trough mysql_query separately.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux