Re: PHP 4.0 Bug #7495: multiple queries.

From: Date: Fri, 27 Oct 2000 08:49:17 +0000
Subject: Re: PHP 4.0 Bug #7495: multiple queries.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-36142@lists.php.net to get a copy of this message
Hello, what use has it to do it this way? It's definitely NOt faster. The MySQL client does do more than one query here too. And it's much cleaner and easier to maintain if you have a loop. Just my 2cts d On 27 Oct 2000 maxim@maxim.cx wrote: > From: maxim@maxim.cx > Operating system: RH6.2 Linux > PHP version: 4.0.2 > PHP Bug Type: MySQL related > Bug description: multiple queries. > > Hello Developers, > > this has just come up on PHP-GENERAL mailing list and I went wild testing it. > > problem: > > if in shell this kind of (MySQL) query works: > > UPDATE table SET column=0 WHERE id=1;UPDATE table SET column=0 WHERE id=2;UPDATE table SET > column=0 WHERE id=3;UPDATE table SET column=0 WHERE id=4;UPDATE table SET column=0 WHERE id=5; > > then why not to make it work in mysql_query() as well? > > It gives you an error like this: > > MySQL Error: 1064: You have an error in your SQL syntax near ';UPDATE table SET column=0 > WHERE id=2;UPDATE table SET column=0 WHERE id=3;U' at line 1 > > This could be SO useful!... > Just think about all these loops we often have to do in order to generate a similar query.. > and we are still putting mysql_query() on each loop.... > > Thanks, > Maxim Maletsky. > > > > -- > Edit Bug report at: http://bugs.php.net/?id=7495&edit=1 > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#36142) next »