WordPress.org

Ready to get started?Download WordPress

Forums

404 Redirected
PHP / MySQL Error (10 posts)

  1. rrhobbs
    Member
    Posted 1 year ago #

    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

    ???

    thanks

    http://wordpress.org/extend/plugins/404-redirected/

  2. kokopelli
    Member
    Posted 1 year ago #

    Me too. Any update on this, or a fix?

    Thanks

  3. edrandall
    Member
    Posted 1 year ago #

    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 ";
  4. rrhobbs
    Member
    Posted 1 year ago #

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

  5. edrandall
    Member
    Posted 1 year ago #

    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 ;-)

  6. rrhobbs
    Member
    Posted 1 year ago #

    edrandall: implemented your fix - thx. didnt throw an error :)

    ;-)

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

    thx :)

  7. kokopelli
    Member
    Posted 1 year ago #

    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).

  8. edrandall
    Member
    Posted 1 year ago #

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

  9. kokopelli
    Member
    Posted 1 year ago #

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

    Thanks

    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.

  10. Marcelo Pedra
    Member
    Posted 1 year ago #

    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
    :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags