• Resolved Tofandel

    (@tofandel)


    In wp-optimize\vendor\team-updraft\common-libs\src\updraft-tasks\class-updraft-task.php on line 332

    You have the following syntax error

    
    $affected = $wpdb->query($wpdb->prepare("
    	UPDATE {$wpdb->base_prefix}tm_tasks
    	SET last_locked_at = %d'
    	WHERE id = %d
    	AND last_locked_at <= %s
    ", time(), $task_id, $expires_at));
    

    Notice the single quote after the %d but not before

    It causes errors during cron updates

    The correct code should be

    
    $affected = $wpdb->query($wpdb->prepare("
    	UPDATE {$wpdb->base_prefix}tm_tasks
    	SET last_locked_at = %d
    	WHERE id = %d
    	AND last_locked_at <= %s
    ", time(), $task_id, $expires_at));
    
    • This topic was modified 6 years, 6 months ago by Tofandel.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Database error’ is closed to new replies.