Welcome Guest, Not a member yet? Register   Sign In
Post data in Model is empty
#1

[eluser]Unknown[/eluser]
I have a problem.

Controller
Code:
$this->load->model('TestModel');
$name = $this->input->post('name');
$data['name'] = $name;
$date['status'] ="1";
$this->TestModel->create($data);

Model
Code:
echo $data['name'];                      //OUTPUT:""
echo $date['status'];                    //OUTPUT:"1"
$this->db->insert('test_table', $data);  //SUCCESS:inserts into database

I don't understand why it inserts the proper name into the database, but the value is empty when i try to perform operations on it.

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB