Support » Plugin: Redirectioner » PHP / MySQL Error

  • The following error appears in my php error log each day recently:

    [05-Dec-2012 06:22:08 UTC] 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 <= 1260080528 and id not in (select redirect_id from truncated-table-prefix’ at line 1 for query select id from table-prefix_wbz404_redirects where status = 2 status timestamp <= 1260080528 and id not in (select redirect_id from table-prefix_wbz404_logs) made by do_action_ref_array, call_user_func_array, wbz404_cleaningCron



Viewing 9 replies - 1 through 9 (of 9 total)
  • Me too. Any update on this, or a fix?


    Me too, just noticed this in my error_log, once every day.

    The error is the SQL lines 401-405 of “404-redirected/includes/functions.php”, reads:

    401) //Find unused urls
    402) $query = "select id from " . $wpdb->prefix . "wbz404_redirects where status = " . $wpdb->escape(WBZ404_AUTO) . " status ";
    403) $query .= "timestamp <= " . $wpdb->escape($then) . " and id not in (";
    404) $query .= "select redirect_id from " . $wpdb->prefix . "wbz404_logs";
    405) $query .= ")";

    that line 402 should read:

    $query = "select id from " . $wpdb->prefix . "wbz404_redirects where status = " . $wpdb->escape(WBZ404_AUTO) . " AND ";

    I have upgraded to WP 3.5 still get the error(s)

    It’s the 404-redirected plugin, we’re running v.1.3.2 which is the latest I think. I just hacked that fix in to the installed copy of the file myself 😉

    edrandall: implemented your fix – thx. didnt throw an error 🙂


    will keep an eye on php logs and report back if problems.

    thx 🙂

    Thanks, I’ll give it a try. 🙂

    BTW, I found the line to be changed on line 331 of my functions.php file (Version: 1.2 of the plugin).

    Seems to be working, nothing at all in my error_log for 2 days.

    The “fix” does seem to prevent errors, but it also removes the 404 Redirected > TOOLS sub-menu in the backend. Any ideas?


    Edit: I just realized I still had V1.2 installed, therefore the mention above to editing different line numbers. If you apply the suggested fix to V1.3.2, the TOOLS menu doesn’t disappear.

    I had the same issue. This fix looks like solved the situation. I will check my error logs in the next days to see if this is finally solved. I’ll be back here if errors come back.
    Thank you @edrandall

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PHP / MySQL Error’ is closed to new replies.