1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mysqli prepare error: Unknown column 'thread.user_id' in 'on clause

Discussion in 'Troubleshooting and Problems' started by Sunny6CM, Mar 24, 2012.

  1. Sunny6CM

    Sunny6CM Member

    Getting the following error.

    Mysqli prepare error: Unknown column 'thread.user_id' in 'on clause

    Full stack trace:

    #0 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('?????SELECT thr...')
    #1 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/Zend/Db/Adapter/Mysqli.php(381): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), '?????SELECT thr...')
    #2 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/Zend/Db/Adapter/Abstract.php(478): Zend_Db_Adapter_Mysqli->prepare('?????SELECT thr...')
    #3 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/XenForo/Model.php(218): Zend_Db_Adapter_Abstract->query('?????SELECT thr...', Array, 2)
    #4 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/XenForo/Model/Thread.php(371): XenForo_Model->fetchAllKeyed('?????SELECT thr...', 'thread_id')
    #5 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/XenForo/Model/Thread.php(426): XenForo_Model_Thread->getThreads(Array, Array)
    #6 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/XenForo/ControllerPublic/Forum.php(87): XenForo_Model_Thread->getThreadsInForum(4, Array, Array)
    #7 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/XenForo/FrontController.php(310): XenForo_ControllerPublic_Forum->actionIndex()
    #8 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/library/XenForo/FrontController.php(132): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #9 /srv/d_6CM001/www/www.sixcrazyminutes.com/htdocs/index.php(13): XenForo_FrontController->run()
    #10 {main}

    Request State:

    array(3) {
    ["url"] => string(65) "http://sixcrazyminutes.com/index.php?forums/the-football-forum.4/"
    ["_GET"] => array(1) {
    ["forums/the-football-forum_4/"] => string(0) ""
    ["_POST"] => array(0) {

    Recently had some malicious activity ( via ftp+password). Cleansed all files, restored database from backup, performed file health check, ran rootkit scanners etc.., passwords were changed and theres been no ftp activity since the original instance.
    Removed all add-ons and issue remains.

    Really at a loss now as to what to do. Can anybody please offer any advice ?

    Really getting desperate now as to what to do next ?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That looks like a problem with the database. Check the database to make sure xf_thread.user_id exists. If it doesn't then that's bad and likely means restoring a backup.
  3. Sunny6CM

    Sunny6CM Member

    No, it doesn't. Table structure is


    I can do a database restore but I'm really reluctant whilst this is going on. I cannot trace what is causing this - there's no ftp activity since the other day - I switched off the FTP service manually. I've done a find on all php files for anything containing "drop column" - nothing to see if there was anything left there but nothing is obvious. Don't know what to look for next. Don't really want to restore only for the same situation to happen again - really trying to identify the cause.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Difficult to know why or when that field disappeared.

    Did you do anything/make any changes/install any add-ons just prior to the problem occurring?

    Which add-ons do you have installed?

Share This Page