Title: SQL syntax &amp; Undefined variables
Last modified: August 31, 2016

---

# SQL syntax & Undefined variables

 *  Resolved [barryalbert](https://wordpress.org/support/users/barryalbert/)
 * (@barryalbert)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/)
 * Thanks for the great plugin. I have been receiving the error and notices below.
 * “You have an error in your SQL syntax; check the manual that corresponds to your
   MySQL server version for the right syntax to use near ‘AND activity = 7’ at line
   1 for query SELECT * FROM cerber_log WHERE stamp = AND activity = 7 made by require_once(‘
   wp-admin/admin.php’), do_action(‘admin_init’), call_user_func_array, cerber_admin_request,
   cerber_send_notify”
 * Trying to get property of non-object
    Type: PHP Notice Line: 817 wp-cerber/wp-
   cerber.php
 * Undefined variable: filters
    Type: PHP Notice Line: 380 wp-cerber/dashboard.php
 * Undefined index: tab
    Type: PHP Notice Line: 443 wp-cerber/settings.php
 * [https://wordpress.org/plugins/wp-cerber/](https://wordpress.org/plugins/wp-cerber/)

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

 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299369)
 * Hi!
 * When and where it is happening? It looks like you are trying to do something 
   with the plugin settings in the Dashboard?
 *  Thread Starter [barryalbert](https://wordpress.org/support/users/barryalbert/)
 * (@barryalbert)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299375)
 * On activation I get this:
    The plugin generated 207 characters of unexpected 
   output during activation. If you notice “headers already sent” messages, problems
   with syndication feeds or other issues, try deactivating or removing this plugin.
 * In the dash board I get the notices. (Undefined index: tab)
    wp-cerber/settings.
   php
 * I have been unable to duplicate the SQL syntax. I will keep trying.
 *  Thread Starter [barryalbert](https://wordpress.org/support/users/barryalbert/)
 * (@barryalbert)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299381)
 * In the dashboard, When you click on Notifications, (Click to send test), I get
   the below errors.+
 * Trying to get property of non-object
    Type: PHP Notice Line: 832 File: /wp-cerber/
   wp-cerber.php
 * You have an error in your SQL syntax; check the manual that corresponds to your
   MySQL server version for the right syntax to use near ‘AND activity IN (10,11)’
   at line 1 for query SELECT * FROM cerber_log WHERE stamp = AND activity IN (10,11)
   made by require_once(‘wp-admin/admin.php’), do_action(‘admin_init’), call_user_func_array,
   cerber_admin_request, cerber_send_notify
    Type: WordPress database error
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299412)
 * Please log out and then log in to the site. Then click on Notification link again.
 * P.S. Make sure that you remember (or add bookmark) Custom login URL, if you have
   set it.
 *  Thread Starter [barryalbert](https://wordpress.org/support/users/barryalbert/)
 * (@barryalbert)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299423)
 * Same db error message. Nothing custom, just the defaults at this point.
 * Undefined index: tab
    Type: PHP Notice Line: 443 File: wp-cerber/settings.php
 * Trying to get property of non-object
    Type: PHP Notice Line: 832 File: wp-cerber/
   wp-cerber.php
 * You have an error in your SQL syntax; check the manual that corresponds to your
   MySQL server version for the right syntax to use near ‘AND activity IN (10,11)’
   at line 1 for query SELECT * FROM cerber_log WHERE stamp = AND activity IN (10,11)
   made by require_once(‘wp-admin/admin.php’), do_action(‘admin_init’), call_user_func_array,
   cerber_admin_request, cerber_send_notify
    Type: WordPress database error
 *  Thread Starter [barryalbert](https://wordpress.org/support/users/barryalbert/)
 * (@barryalbert)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299436)
 * get_currentuserinfo is deprecated since version 4.5! Use wp_get_current_user()
   instead.
 * On activation errors:
    wp-cerber.php(394): get_currentuserinfo(); wp-cerber.php(
   472): get_currentuserinfo(); wp-cerber.php(1041): if (!$current_user->ID) get_currentuserinfo();
 * Replace with “wp_get_current_user();” and the activation errors are gone.
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299477)
 * Thanks for telling me about deprecated function, I’ll fix it with next release
   soon.
    On DB error message, I need to know what do you see on the Activity tab?
   Is it empty? What activity do you see?
 *  Thread Starter [barryalbert](https://wordpress.org/support/users/barryalbert/)
 * (@barryalbert)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299479)
 * It shows my login, so its populating.
 * This is on a test site if you need to login and see.
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299497)
 * So, I found out cause of that db error. That’s a small bug. You need to have (
   or make it manually) at least one lockout on the Activity tab to get rid of it.
   Or just disable WP_DEBUG.
    None of those notices or db error are affecting plugin
   functionality, except testing notification letter.
 * Anyway, I’ll fix that soon. Thanks for telling me.

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

The topic ‘SQL syntax & Undefined variables’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cerber_77a9bf.svg)
 * [WP Cerber Security, Anti-spam & Malware Scan](https://wordpress.org/plugins/wp-cerber/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cerber/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cerber/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cerber/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cerber/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cerber/reviews/)

## Tags

 * [non object](https://wordpress.org/support/topic-tag/non-object/)
 * [SQL syntax](https://wordpress.org/support/topic-tag/sql-syntax/)
 * [undefined variable](https://wordpress.org/support/topic-tag/undefined-variable/)

 * 9 replies
 * 2 participants
 * Last reply from: [gioni](https://wordpress.org/support/users/gioni/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/sql-syntax-undefined-variables/#post-7299497)
 * Status: resolved