Title: SQL error in php_errorlog
Last modified: November 1, 2020

---

# SQL error in php_errorlog

 *  Resolved [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * (@prehealthshadowing)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/sql-error-in-php_errorlog/)
 * Hello again [@javmah](https://wordpress.org/support/users/javmah/),
 * Thanks for the recent update – it did resolve the issues we were having and I
   have re-enabled the plugin. I’m looking through my error logs and see a regular
   error occurring in php_errorlog. I’m not sure if it was there before, but it 
   is happening often.
 * WordPress database error Table ‘XXXXXXX.wp_postmeta’ doesn’t exist for query 
   SELECT * FROM 5TO_posts INNER JOIN `wp_postmeta` ON `wp_posts`.`ID` = `wp_postmeta`.`
   post_id` WHERE `wp_posts`.`post_type` = ‘wpcf7_contact_form’ AND `wp_postmeta`.`
   meta_key` = ‘_form’
 * I think I’ve resolved it locally by changing this line:
    $cf7Forms = $wpdb->get_results(“
   SELECT * FROM {$wpdb->prefix}posts INNER JOIN `wp_postmeta` ON `wp_posts`.`ID`
   = `wp_postmeta`.`post_id` WHERE `wp_posts`.`post_type` = ‘wpcf7_contact_form’
   AND `wp_postmeta`.`meta_key` = ‘_form’ ” );
 * to
 * $cf7Forms = $wpdb->get_results( “SELECT * FROM {$wpdb->prefix}posts INNER JOIN{
   $wpdb->prefix}postmeta ON {$wpdb->prefix}posts.`ID` = {$wpdb->prefix}postmeta.`
   post_id` WHERE {$wpdb->prefix}posts.`post_type` = ‘wpcf7_contact_form’ AND {$
   wpdb->prefix}postmeta.`meta_key` = ‘_form’ ” );
 * Can you confirm this fix, and patch if appropriate?
 * Thanks again!

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

 *  Plugin Author [javmah](https://wordpress.org/support/users/javmah/)
 * (@javmah)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/sql-error-in-php_errorlog/#post-13606565)
 * I appreciate your effort. I change the SQL prefix Please See the code. I didn’t
   change the version. regards
 *  Plugin Author [javmah](https://wordpress.org/support/users/javmah/)
 * (@javmah)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/sql-error-in-php_errorlog/#post-13606957)
 * Could you please create a support ticket from the plugin contact page so that
   I can send you a pre-release version? Best Regards.
 *  Thread Starter [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * (@prehealthshadowing)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/sql-error-in-php_errorlog/#post-13608163)
 * [@javmah](https://wordpress.org/support/users/javmah/) – I can’t find the spot
   you are referring to to file a ticket. I thought that is what the forum is for.
   Regardless, I don’t think its necessary to get a pre-release – I made the change
   locally and haven’t seen the issue since I made it. I’ll grab the next patch 
   build you put out.

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

The topic ‘SQL error in php_errorlog’ is closed to new replies.

 * ![](https://ps.w.org/wpgsi/assets/icon-256x256.gif?rev=2560092)
 * [WPGSI: Spreadsheet Integration](https://wordpress.org/plugins/wpgsi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpgsi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpgsi/)
 * [Active Topics](https://wordpress.org/support/plugin/wpgsi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpgsi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpgsi/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [prehealthshadowing](https://wordpress.org/support/users/prehealthshadowing/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/sql-error-in-php_errorlog/#post-13608163)
 * Status: resolved