Title: Extra underscore in SELECT statement
Last modified: March 21, 2019

---

# Extra underscore in SELECT statement

 *  Resolved [Mike Meinz](https://wordpress.org/support/users/mikemeinz/)
 * (@mikemeinz)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/)
 * Version: 1.11.8
 * In **includes/any-post.php** line 138, there is an extra underscore character
   that causes this error to be logged:
    `[21-Mar-2019 12:33:23 UTC] WordPress database
   error Table 'i830414wp1.wp__blc_instances' doesn't exist for query SELECT instance_id
   FROM wp__blc_instances WHERE container_id = 27690 AND container_type = 'page'
   made by do_action_ref_array('wp_scheduled_auto_draft_delete'), WP_Hook->do_action,
   WP_Hook->apply_filters, wp_delete_auto_drafts, wp_delete_post, do_action('delete_post'),
   WP_Hook->do_action, WP_Hook->apply_filters, blcPostTypeOverlord->post_deleted`
 * Now Reads:
 *     ```
       			$q_current_instance_ids = $wpdb->prepare( 
       				'SELECT instance_id FROM <code>'.$wpdb->prefix.'_blc_instances</code> WHERE container_id = %d AND container_type = %s', 
       				$post_id,
       				$post_type );
       ```
   
 * Should Read:
 *     ```
       			$q_current_instance_ids = $wpdb->prepare( 
       				'SELECT instance_id FROM <code>'.$wpdb->prefix.'blc_instances</code> WHERE container_id = %d AND container_type = %s', 
       				$post_id,
       				$post_type );
       ```
   
    -  This topic was modified 7 years, 2 months ago by [Mike Meinz](https://wordpress.org/support/users/mikemeinz/).

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

 *  [tomboersma](https://wordpress.org/support/users/tomboersma/)
 * (@tomboersma)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11366744)
 * Same error here, needs fixing.
 *  [hongpong](https://wordpress.org/support/users/hongpong/)
 * (@hongpong)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11413767)
 * this has been filed on the community fork and any PR is welcome
 * [https://github.com/HongPong/broken-link-checker/issues/36](https://github.com/HongPong/broken-link-checker/issues/36)
 *  [Alex](https://wordpress.org/support/users/alexwatermann/)
 * (@alexwatermann)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11472559)
 * this issue appears also on line 152 and 159
 *  [blazmate](https://wordpress.org/support/users/blazmate/)
 * (@blazmate)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11734723)
 * I have this error in the log every day. Is this plugin not in use now?
 *  [staipa](https://wordpress.org/support/users/staipa/)
 * (@staipa)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11750241)
 * No solutions?
 *  [Alex](https://wordpress.org/support/users/alexwatermann/)
 * (@alexwatermann)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11753246)
 * [@staipa](https://wordpress.org/support/users/staipa/) The solution is given 
   by _**Mike Meinz**_. Remove the additional underscore from your SQL query string.
   
   Here an example (German description): [WordPress-Datenbank-Fehler: Table ‚blc_instances‘ doesn’t exist](http://www.technik-tipps-und-tricks.de/wordpress-datenbank-fehler-table-blc_instances-doesnt-exist/)
 *  [staipa](https://wordpress.org/support/users/staipa/)
 * (@staipa)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11753268)
 * Modifiing directly the plugin code?
 *  [Alex](https://wordpress.org/support/users/alexwatermann/)
 * (@alexwatermann)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11753375)
 * Yes! There is no suitable filter hook to overwrite the SQL query string.
 *  [staipa](https://wordpress.org/support/users/staipa/)
 * (@staipa)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11754310)
 * But plugin is no more supported? It can be changed by developers?
 *  [stilfx](https://wordpress.org/support/users/stilfx/)
 * (@stilfx)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-11915245)
 * So simple, how is this not patched yet?
 *  Thread Starter [Mike Meinz](https://wordpress.org/support/users/mikemeinz/)
 * (@mikemeinz)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-12255316)
 * This problem was identified in three SQL statements in Version 1.11.8. Version
   1.11.9 was released some time ago and this problem is still not fixed.
 * Please remove underscore character in front of **blc_instances**
 * broken-link-checker\includes\any-post.php
    275 ‘SELECT instance_id FROM`'.$wpdb-
   >;prefix.'_blc_instances` WHERE container_id = %d AND container_type = %s’, 303
   $q_current_link_ids = ‘SELECT DISTINCT link_id FROM `'.$wpdb->prefix.'_blc_instances`
   WHERE instance_id IN (\”.implode(“‘, ‘”, $current_instance_ids).’\’)’; 317 $wpdb-
   >;query( ‘DELETE FROM `'.$wpdb->prefix.'_blc_instances` WHERE instance_id IN (\”.
   implode(“‘, ‘”, $current_instance_ids).’\’)’ );
    -  This reply was modified 6 years, 5 months ago by [Mike Meinz](https://wordpress.org/support/users/mikemeinz/).
    -  This reply was modified 6 years, 5 months ago by [Mike Meinz](https://wordpress.org/support/users/mikemeinz/).
    -  This reply was modified 6 years, 5 months ago by [Mike Meinz](https://wordpress.org/support/users/mikemeinz/).
    -  This reply was modified 6 years, 5 months ago by [Mike Meinz](https://wordpress.org/support/users/mikemeinz/).
    -  This reply was modified 6 years, 5 months ago by [Mike Meinz](https://wordpress.org/support/users/mikemeinz/).
 *  Thread Starter [Mike Meinz](https://wordpress.org/support/users/mikemeinz/)
 * (@mikemeinz)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-12294989)
 * This issue was fixed in Version 1.11.10.

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

The topic ‘Extra underscore in SELECT statement’ is closed to new replies.

 * ![](https://ps.w.org/broken-link-checker/assets/icon-256x256.png?rev=2900468)
 * [Broken Link Checker](https://wordpress.org/plugins/broken-link-checker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/broken-link-checker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/broken-link-checker/)
 * [Active Topics](https://wordpress.org/support/plugin/broken-link-checker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/broken-link-checker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/broken-link-checker/reviews/)

## Tags

 * [underscore](https://wordpress.org/support/topic-tag/underscore/)

 * 12 replies
 * 7 participants
 * Last reply from: [Mike Meinz](https://wordpress.org/support/users/mikemeinz/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/extra-underscore-in-select-statement/#post-12294989)
 * Status: resolved