Custom Post Status 404 URL

this function changes the post to draft, you only have to call it and pass the post id where you want the function to work

function postToDraft($post_id){
    $post = array( 'ID' => $post_id, 'post_status' => 'draft' );
    wp_update_post($post);
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)