PHP 4.0 Bug #7495 Updated: multiple queries.

From: Date: Thu, 07 Dec 2000 16:59:23 +0000
Subject: PHP 4.0 Bug #7495 Updated: multiple queries.
Groups: php.dev 
Request: Send a blank email to php-dev+get-40461@lists.php.net to get a copy of this message
ID: 7495 Updated by: sniper Reported By: maxim@maxim.cx Status: Closed Bug Type: MySQL related Assigned To: Comments: No feedback. Previous Comments: --------------------------------------------------------------------------- [2000-10-27 17:23:34] mathieu@php.net Why not use: UPDATE table SET column = 0 WHERE ID IN ( 1,2,3,4,5 ); --Mathieu --------------------------------------------------------------------------- [2000-10-27 16:19:03] maxim@maxim.cx 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. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7495

« previous php.dev (#40461) next »