Title: [Plugin: Better WP Security] SQL errror in function lockout()
Last modified: August 20, 2016

---

# [Plugin: Better WP Security] SQL errror in function lockout()

 *  Resolved [b.l.k](https://wordpress.org/support/users/blk-1/)
 * (@blk-1)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-sql-errror-in-function-lockout/)
 * Hello,
    there is an SQL error in the function lockout() in secure.php when BWPS
   tries to ban an host:
 *     ```
       $wpdb->insert(
       	$wpdb->base_prefix . 'bwps_lockouts',
       	array(
       		'type' => $type,
       		'active' => 1,
       		'starttime' => $currtime,
       		'exptime' => $exptime,
       		'host' => $wpdb->escape( $_SERVER['REMOTE_ADDR'] ),
       		'user' => ''
       	)
       );
       ```
   
 * the column user is defined as bigint(20) and an empty string is sent in the query.
 * The correct query should be :
 *     ```
       $wpdb->insert(
       	$wpdb->base_prefix . 'bwps_lockouts',
       	array(
       		'type' => $type,
       		'active' => 1,
       		'starttime' => $currtime,
       		'exptime' => $exptime,
       		'host' => $wpdb->escape( $_SERVER['REMOTE_ADDR'] ),
       		'user' => 0
       	)
       );
       ```
   
 * or maybe you can try to send NULL ?
 * Could you confirm this is an error and fix it in the next release ?
 * Thank you for your answer
 * [http://wordpress.org/extend/plugins/better-wp-security/](http://wordpress.org/extend/plugins/better-wp-security/)

Viewing 1 replies (of 1 total)

 *  [Bit51 (part of the iThemes family)](https://wordpress.org/support/users/bit51/)
 * (@bit51)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-sql-errror-in-function-lockout/#post-2921567)
 * Thanks for the report. I will fix it for the next release.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Better WP Security] SQL errror in function lockout()’ is closed
to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=2980272)
 * [Solid Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bit51 (part of the iThemes family)](https://wordpress.org/support/users/bit51/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-sql-errror-in-function-lockout/#post-2921567)
 * Status: resolved