i have problem here about inserting data using ajax with JQGrid, when i try pass the data its say succses but not stored in database , i think i have problem with ajax or add function in php 
here my ajax
function AddPost(params) {
    $.ajax({
        url: '<?php echo base_url() ?>index.php/Welcome/tambah_data',
        data: {
            nama: params.nama,
            deskripsi: params.deskripsi,
            user_id: params.user_id,
            created_time: params.created_time,
        },
        async: 'true',
        cache: 'false',
        type: 'post',
        success: function (data) {
            alert("Data successfully added");
        },
        error:function(data){
            alert("error happend");
        }
    }); 
    console.log(params);            
}
and here my controller
    function tambah_data(){
$id=$_POST['id'];
$name=$_POST['name'];
$deskripsi=$_POST['deskripsi'];
$user_id=$_POST['user_id'];
$created_time=$_POST['created_time'];
$sql = "INSERT INTO `master_matakuliah`( `id`, `name`, `deskripsi`, `user_id`,`created_time`) 
VALUES ('$id','$name','$deskripsi','$user_id','$created_time')";
if (mysqli_query($conn, $sql)) {
    echo json_encode(array("statusCode"=>200));
} 
else {
    echo json_encode(array("statusCode"=>201));
}
mysqli_close($conn);
}
can some help me with this ? , sorry for my bad english,thanks
