Title: Cron throwing errors in error log
Last modified: August 21, 2016

---

# Cron throwing errors in error log

 *  [SoN9ne](https://wordpress.org/support/users/son9ne/)
 * (@son9ne)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/cron-throwing-errors-in-error-log/)
 * I receive errors like:
    `[Thu Jun 12 10:10:40 2014] [error] [client 127.0.0.1]
   WordPress database error 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'
   status timestamp <= 1307977840 and id not in (select redirect_id from wp_wbz404_'
   at line 1 for query select id from wp_wbz404_redirects where status = 2 status
   timestamp <= 1307977840 and id not in (select redirect_id from wp_wbz404_logs)
   made by do_action_ref_array, call_user_func_array, wbz404_cleaningCron`
 * A closer look shows that line **402** of **functions.php** seems to be the issue.
   
   This line is: `$query = "select id from " . $wpdb->prefix . "wbz404_redirects
   where status = " . $wpdb->escape(WBZ404_AUTO) . " status ";`
 * I believe the fix is: `$query = "select id from " . $wpdb->prefix . "wbz404_redirects
   where status = " . $wpdb->escape(WBZ404_AUTO) . " AND ";`
 * Thanks.
 * [https://wordpress.org/plugins/404-redirected/](https://wordpress.org/plugins/404-redirected/)

The topic ‘Cron throwing errors in error log’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/404-redirected.svg)
 * [Redirectioner](https://wordpress.org/plugins/404-redirected/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/404-redirected/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/404-redirected/)
 * [Active Topics](https://wordpress.org/support/plugin/404-redirected/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/404-redirected/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/404-redirected/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [SoN9ne](https://wordpress.org/support/users/son9ne/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/cron-throwing-errors-in-error-log/)
 * Status: not resolved