Welcome Guest, Not a member yet? Register   Sign In
Why these codes won't insert?
#1

[eluser]whygod[/eluser]
In MY_model,

Code:
function add_group() {
  $data = array(
     'name' => 'dentist' ,
     'description' => 'dentist' ,
  );
  
  $this->db->insert('groups', $data);
  
  if($this->db->affected_rows() > 0)
  {
   echo 'Data saved.';  
  }
  else
  {
   echo 'Data not saved.';
  }

}

In my controller:
Code:
function add_group() {
  $this->dental_model->add_group();
}

The problem here it doesn't insert the record.

When I execute this it says it saved the data successfully.
But when I checked if it really saved I don't see the newly inserted data.
Why?

Thank you very much in advanced.


Messages In This Thread
Why these codes won't insert? - by El Forum - 02-10-2013, 09:01 PM
Why these codes won't insert? - by El Forum - 02-10-2013, 10:17 PM
Why these codes won't insert? - by El Forum - 02-10-2013, 10:26 PM
Why these codes won't insert? - by El Forum - 02-10-2013, 10:53 PM
Why these codes won't insert? - by El Forum - 02-10-2013, 11:42 PM
Why these codes won't insert? - by El Forum - 02-11-2013, 10:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB