ID: 27497 Updated by: [EMAIL PROTECTED] Reported By: leonard at den dot ottolander dot nl Status: Bogus Bug Type: DBX related Operating System: Linux (RH 9 and FC 1) PHP Version: 4.3.4 New Comment:
afaik you can't have a space between COUNT and (, but nonetheless this is NOT a PHP bug as we just return the error from MySQL. PHP doesn't touch the queries at all. Previous Comments: ------------------------------------------------------------------------ [2004-03-04 16:33:41] leonard at den dot ottolander dot nl Ok. I can reproduce this when using mysql_query as well. Can you recomponent this or should I refile under mysql? And why is this no issue when running the same query using phpMyAdmin? ------------------------------------------------------------------------ [2004-03-04 15:08:53] leonard at den dot ottolander dot nl ? I use mysql as a backend. Running the same query in phpMyAdmin works just fine. ------------------------------------------------------------------------ [2004-03-04 13:45:32] [EMAIL PROTECTED] This doesn't have anything to do with DBX, but with the database backend that you use for it. That one simply doesn't support "COUNT". Not a bug in PHP -> bogus. ------------------------------------------------------------------------ [2004-03-04 13:32:44] leonard at den dot ottolander dot nl Description: ------------ dbx gives a syntax error when using COUNT: SELECT COUNT (`ID`) FROM `category` WHERE `packageID` = 593 You have an error in your SQL syntax near '(`ID`) FROM `category` WHERE `packageID` = 593' at line 1 First seen on Red Hat Linux 9, php-4.2.2, but reproduced on Fedora Core 1, php-4.3.4. Reproduce code: --------------- $q = ...COUNT...; echo $q; $res = dbx_query($link, $q); if ($res == 0) { echo dbx_error($link); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27497&edit=1