This is a discussion on mysql query in PHP within the PHP Language forums, part of the PHP Programming Forums category; hi everybody, i got a strange problem with a simple mysql query in php. simply, it doesn't work on ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG |
|
|||
|
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 | +-----------------------------------------------------+ |
|
|||
|
fra wrote:
> any idea? Please don't multi-post. http://www.cs.tut.fi/~jkorpela/usenet/xpost.html#why http://oakroadsystems.com/genl/unice.htm#xpost Answered in comp.databases.mysql. -- File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot |
|
|||
|
> In think that you must not leave spaces between a function name (SUM)
> and its arguments: SUM( numore ) right, thanks francesco -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG |