^ [ref] > FROM `utentiAzioni` > WHERE completata = '1' > GROUP BY operatore, azione ORDER BY operatore > "[/ref] When I tried your query without the space after SUM it worked as expected :) -- File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => <01018eb153be6da44dc5592681f048b8.32828@mygate.mailgate.org> [htmlstate] => on_nl2br [postusername] => Pedro [ip] => hexkid@dodgeit. [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> mysql query in php: doesn't work - MySQL

mysql query in php: doesn't work - MySQL

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 ...

  1. #1

    Default mysql query in php: doesn't work

    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 Guest

  2. #2

    Default Re: mysql query in php: doesn't work

    On Fri, 6 Oct 2006 11:09:48 +0000 (UTC), "fra" <com>
    wrote:
     

    Try removing the space between SUM & (
    SUM(
    instead of
    SUM (
    Lee Guest

  3. #3

    Default Re: mysql query in php: doesn't work

    fra wrote: 
    ---------------------------------------------> ^
     

    When I tried your query without the space after SUM it worked as
    expected :)

    --
    File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
    Pedro Guest

  4. #4

    Default Re: mysql query in php: doesn't work

     
    it works. thx



    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
    Francesco Guest

Similar Threads

  1. Query by date doesn't work
    By wantaknowcf in forum Coldfusion Database Access
    Replies: 5
    Last Post: October 31st, 02:28 PM
  2. search query doesn't work
    By Krechting in forum ASP Database
    Replies: 6
    Last Post: January 2nd, 04:17 PM
  3. #24742 [NEW]: mysql functions doesn't work.
    By webmaster at trip-fx dot com in forum PHP Development
    Replies: 0
    Last Post: July 21st, 08:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139