• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Messages In This Thread
Post data in Model is empty - by El Forum - 01-07-2012, 05:58 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.