WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] MySQL errors in site (8 posts)

  1. trdunsworth
    Member
    Posted 4 years ago #

    We have been having database issues after someone tried to penetrate the site.

    We are receiving the following error code even after clear reloads of files and after clean database restructuring.

    WordPress database error 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 'order ASC' at line 1 for query SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') AND ( t.term_id <> 1 AND t.term_id <> 7 AND t.term_id <> 10 AND t.term_id <> 4 AND t.term_id <> 13 AND t.term_id <> 3 AND t.term_id <> 12 AND t.term_id <> 8 AND t.term_id <> 9 AND t.term_id <> 11 AND t.term_id <> 13 ) ORDER BY order ASC made by require, require_once, include, get_sidebar, locate_template, load_template, require_once, wp_list_categories, get_categories, get_terms

    We've disabled all the plug-ins and we're still getting the same errors. We've used Repair Tables from PHPMyAdmin and that seems to stop the errors for a few seconds.

    Any thoughts or ideas are appreciated at the moment.

    Tony

  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. trdunsworth
    Member
    Posted 4 years ago #

    Thanks. We found what started the cavalcade was a rogue file. We restored the db to a previously good version and now we're trying to figure out why we're still getting the error above when the db is clean.

  4. Samuel B
    moderator
    Posted 4 years ago #

    you may want to download your db .sql file and do a search for "eval", "base 64", etc.

  5. trdunsworth
    Member
    Posted 4 years ago #

    I will try that one. What we've noticed is that neither of our tables wp_terms and wp_terms_taxonomy as an order field so the ORDER BY is creating the error.

    It shows up in the error.log file every time a user moves from one page to another in the site.

    While I'm going through the .sql dump, does this shed any better light on the situation?

    Thank you all for your help.

  6. trdunsworth
    Member
    Posted 4 years ago #

    It appears our issue is hiding in our sidebar and now we have to figure out how to set it correctly.

  7. trdunsworth
    Member
    Posted 4 years ago #

    We've found the issue in the sidebar and corrected it which has removed the errors. It was a code issue in the theme.

  8. Samuel B
    moderator
    Posted 4 years ago #

    yikes - well glad you found it

Topic Closed

This topic has been closed to new replies.

About this Topic