Insert Query Working for Localhost but not Web Server

This code is Working for localhost Xampp server but not working in live Web Server Please give me Right way to execute the in live web server

    public function add_new_task($data){
        // data insert   
        $task_title = $this->test_form_input_data($data['task_title']);
        $task_description = $this->test_form_input_data($data['task_description']);
        $t_start_time = $this->test_form_input_data($data['t_start_time']);
        $t_end_time = $this->test_form_input_data($data['t_end_time']);
        $assign_to = $this->test_form_input_data($data['assign_to']);
        $assign_by = $this->test_form_input_data($data['assign_by']);
        $reviewer = $this->test_form_input_data($data['reviewer']);
        $updated_by = $this->test_form_input_data($data['updated_by']);
        $request_note = $this->test_form_input_data($data['request_note']);

        try{
            $add_task = $this->db->prepare("INSERT INTO task_info (t_title, t_description, t_start_time,    t_end_time, t_user_id, u_comment,as_user_name,rv_name,up_name) VALUES (:x, :y, :z, :a, :b, :uc, :v, :m, :q) ");

            $add_task->bindparam(':x', $task_title);
            $add_task->bindparam(':y', $task_description);
            $add_task->bindparam(':z', $t_start_time);
            $add_task->bindparam(':a', $t_end_time);
            $add_task->bindparam(':b', $assign_to);
            $add_task->bindparam(':uc', $request_note);
            $add_task->bindparam(':v', $assign_by);
            $add_task->bindparam(':m', $reviewer);
            $add_task->bindparam(':q', $updated_by);

            $add_task->execute();

            $_SESSION['Task_msg'] = 'Task Add Successfully';

            header('Location: task-info.php');
        }catch (PDOException $e) {
            echo $e->getMessage();
        }
    }

When I am inserting the data then data is not showing in the webserver database, that is the problem. not showing any kind of data whenever I have filled data in web server and also not showing any kind of errors in the interface.
But when I am inserting the data in localhost xampp server it showing the data that I have inserted in localhost server.