Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unknown column 'infractiongroupid' in 'field list'

    Whats the problem? Why is it doing this & how can I fix it?
    Invalid SQL:

    Code:
    SELECT
    user.username, 
    (user.options & 512) AS invisible, 
    user.usergroupid,
    session.userid, 
    session.inforum, 
    session.lastactivity,
    IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
    FROM session AS session
    LEFT JOIN user AS user ON(user.userid = session.userid)
    WHERE session.lastactivity > 1155786772
    ORDER BY username ASC;
    
    MySQL Error  : Unknown column 'infractiongroupid' in 'field list'
    Error Number : 1054
    Date         : Wednesday, August 16th 2006 @ 09:07:52 PM
    Script       : 
    Referrer     : 
    IP Address   : 
    Username     : 
    Classname    : vb_database
    Last edited by guelphdad; 08-17-2006 at 01:25 PM.

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    it looks like maybe you've updated the code of your application without running the necessary database updates? (or vice-versa...)

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    what are you doing on this line:
    Code:
    IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
    it seems like you are trying to call two columns at once and give the second one an alias. I don't believe you can do that.


  •  

    Posting Permissions

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