Announcement

Collapse
No announcement yet.

whats wrong with this sql statment?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • whats wrong with this sql statment?

    $user=$DB_site->query_first("SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate
    avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
    FROM user
    LEFT JOIN avatar ON avatar.avatarid=user.avatarid
    LEFT JOIN customavatar ON customavatar.userid=user.userid
    WHERE user.userid=$userid");


    I ask because i am getting error message when trying to edit user in admin cp which seems to point to it, this is a clean install of 2.2.6:



    Database error in vBulletin Control Panel 2.2.6:

    Invalid SQL: SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate
    avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
    FROM user
    LEFT JOIN avatar ON avatar.avatarid=user.avatarid
    LEFT JOIN customavatar ON customavatar.userid=user.userid
    WHERE user.userid=6
    mysql error: You have an error in your SQL syntax near 'avatar.avatarpath,NOT ISNULL(customavatar.avatardata
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X