Search code examples
mysqldatabasewordpressplesk

WordPress database error log yet Blog loads and looks fine


I'm trying to hunt down an error that keeps appearing in my Plesk log for a Wordpress install I have. It uses the theme Colornews and I'm able to load the blog and it appears to look as expected. The error shows in the log as this:

AH01071: Got error 'PHP message: WordPress database error Table 'blog_database.wp_commentsINNER' doesn't exist for query \n\t\t\t\t\tSELECT wpcoms.*, wpposts.ID, wpposts.comment_count, wpposts.post_title\n\t\t\t\t\tFROM (\n\t\t\t\t\t\tSELECT *,\n\t\t\t\t\t\t\t@num := if(@post_id = comment_post_ID, @num + 1, 1) as row_number,\n\t\t\t\t\t\t\t@post_id := comment_post_ID as cpID\n\t\t\t\t\t\tFROM wp_commentsINNER JOIN wp_posts wpposts\n\t\t\t\t\t\t\t\tON (comment_post_ID = wpposts.ID\n\t\t\t\t\t\t\t\t\tAND (wpposts.post_status = 'publish' OR wpposts.post_status = 'inherit') \n\t\t\t\t\t\t\t\t\tAND wpposts.post_password = '' AND wpposts.post_type = 'post' )\n\t\t\t\t\t\t\tWHERE comment_approved = 1 AND comment_type = '' ORDER BY comment_post_ID DESC, comment_ID DESC \n\t\t\t\t\t) as wpcoms\n\t\t\t\t\t\tWHERE wpcoms.row_number <= 3\n\t\t\t\t\t\t\tORDER BY wpcoms.comment_date DESC\n\t\t\t\t\t\tLIMIT 3 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/colornews/index.php'), get_sidebar, locate_template, load_template, require_once('/themes/colornews/sidebar.php'), dynamic_sidebar, W...\n'

Its a long shot but wondered if anyone could point me in the right direction to fix the error.

Thanks Chris


Solution

  • The error is self-explanatory. There's an error in the SQL query:

    wp_commentsINNER
    

    the space is missing between the table name and the INNER. Locate where that query is executed and fix it.