| 
	
 | 
 Posted by Lorenzo Bettini on 10/06/06 12:11 
fra wrote: 
> hi everybody, 
> i got a strange problem with a simple mysql query in php. 
> simply, it doesn't work on my page (while it does through phpmyadmin): 
> there's the query: 
> $sql=" 
> SELECT operatore, azione, COUNT( azione ), SUM ( numore ) 
> FROM `utentiAzioni` 
> WHERE completata = '1' 
> GROUP BY operatore, azione ORDER BY operatore 
> " 
> the error message is: 
>  "You have an error in your SQL syntax; check the manual that 
> corresponds  to your MySQL server version for the right syntax to use 
> near '( numore )  FROM `utentiAzioni` WHERE completata = '1' GROUP BY 
> a..." 
>  
> any idea? 
> thanks in advance 
> francesco 
>  
>  
 
In think that you must not leave spaces between a function name (SUM) 
and its arguments: SUM( numore ) 
 
--  
+-----------------------------------------------------+ 
|  Lorenzo Bettini          ICQ# lbetto, 16080134     | 
|  Home Page        : http://www.lorenzobettini.it    | 
|  http://tronprog.blogspot.com  BLOG                 | 
|  http://www.purplesucker.com Deep Purple Cover Band | 
|  http://www.gnu.org/software/src-highlite           | 
|  http://www.gnu.org/software/gengetopt              | 
|  http://www.lorenzobettini.it/software/gengen       | 
|  http://www.lorenzobettini.it/software/doublecpp    | 
+-----------------------------------------------------+
 
[Back to original message] 
 |