Title: Database prefix error
Last modified: December 23, 2019

---

# Database prefix error

 *  Resolved [lozula](https://wordpress.org/support/users/lozula/)
 * (@lozula)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-prefix-error/)
 * I am getting a php error in the server log when I change the resmush.it compression
   amount. I have a database table prefix set in my wp_config.php file using the
   variable
 * $table_prefix
 * But the error seems to suggest that the query is ignoring the table prefix and
   just using xxxxxxx.wp_posts (xxxxxxx is where my database name would be), when
   it should be
 * xxxxxxxxxx.wp_$table_prefix_posts
 * [Mon Dec 23 13:35:27.734468 2019] [proxy_fcgi:error] [pid 26081] [client 127.0.0.1:
   39940] AH01071: Got error ‘PHP message: WordPress database error Table ‘xxxxxxxxxx.
   wp_posts’ doesn’t exist for query SELECT ATTACHMENTS.* FROM (\n\t\t\t\tselect\
   n\t\t\t\t\tPOSTS.ID as ID, METAQLTY.meta_value as qlty, METADISABLED.meta_value
   as disabled\n\t\t\t\t\t,POSTS.guid as guid, METAATTACH.meta_value as file_meta\
   n\t\t\t\tfrom wp_posts as POSTS\n\t\t\t\tinner join \n\t\t\t\t\twp_postmeta as
   METAATTACH on POSTS.ID = METAATTACH.post_id \n\t\t\t\t\tand METAATTACH.meta_key
   = ‘_wp_attachment_metadata’ \n\t\t\t\tleft join \n\t\t\t\t\twp_postmeta as METAQLTY
   on POSTS.ID = METAQLTY.post_id \n\t\t\t\t\tand METAQLTY.meta_key = ‘resmushed_quality’\
   n\t\t\t\tleft join \n\t\t\t\t\twp_postmeta as METADISABLED on POSTS.ID = METADISABLED.
   post_id \n\t\t\t\t\tand METADISABLED.meta_key = ‘resmushed_disabled’\n\t\t\t\
   twhere \n\t\t\t\t\tPOSTS.post_type = ‘attachment’\n\t\t\t\t\tand (POSTS.post_mime_type
   = ‘image/jpeg’ OR POSTS.post_mime_type = ‘image/gif’ OR POSTS.post_mime_type 
   = ‘image/png’)\n\t\t\t\t) as ATTACHMENTS\n\t\t\t\tWHERE \n\t\t\t\t\t(ATTACHMENTS.
   qlty != ’75’ OR ATTACHMENTS.qlty IS NULL)\n\t\t\t\t\tAND ATTACHMENTS.disabled
   IS NULL\n\t\t\t\tLI…’, referer: [https://www.findingtheuniverse.com/wp-admin/upload.php?page=resmushit_options](https://www.findingtheuniverse.com/wp-admin/upload.php?page=resmushit_options)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [reSmush.it](https://wordpress.org/support/users/resmushit/)
 * (@resmushit)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-prefix-error/#post-12265331)
 * Hi [@lozula](https://wordpress.org/support/users/lozula/),
 * Ok, we’ll have a look quickly, stay in touch !
    Cheers, Charles
 *  Plugin Contributor [reSmush.it](https://wordpress.org/support/users/resmushit/)
 * (@resmushit)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-prefix-error/#post-12265375)
 * Hi [@lozula](https://wordpress.org/support/users/lozula/),
 * The correction was already detected and has been fixed in the meantime.
    A new
   release is now available which will fix it 🙂
 * Cheers,
    Charles
 * PS : do not forget to rate our plugin if you liked it !
 *  Thread Starter [lozula](https://wordpress.org/support/users/lozula/)
 * (@lozula)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-prefix-error/#post-12265411)
 * Great, that does seem to have fixed it. Thanks for the quick response and for
   continuing to support this awesome plugin 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Database prefix error’ is closed to new replies.

 * ![](https://ps.w.org/resmushit-image-optimizer/assets/icon-256x256.png?rev=3049668)
 * [reSmush.it : The original free image compressor and optimizer plugin](https://wordpress.org/plugins/resmushit-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/resmushit-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/resmushit-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/resmushit-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/resmushit-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/resmushit-image-optimizer/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [lozula](https://wordpress.org/support/users/lozula/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/database-prefix-error/#post-12265411)
 * Status: resolved