Welcome Guest, Not a member yet? Register   Sign In
Problem with Insert Data into Sql Server's Table
#1

Hi Guys, need your help, i faced problem when inserting data into sql server's table. I've tried several methods namely :

here is my model syntax
Code:
$this->db->insert('tb_customer',$data)
where my controller function like this :
Code:
function save(){
$this->load->model('m_customer');        
$name            = $this->input->post('name');
$status            = $this->input->post('status');
$email            = $this->input->post('email');
$handphone        = $this->input->post('handphone');
$address        = $this->input->post('address');        

$data =  array (          'name'        =>  $name,
                         'status'            =>  $status,        
                         'email'        =>  $email,  
                         'handphone'        =>  $handphone,          
              'address'        =>  $address                                                                                           
                );
$this->m_customer->InsertCustomer('tb_customer',$data);
}
and
Code:
$this->db->set('name', $this->input->post('namepelanggan'));
$this->db->set('status', $this->input->post('status'));
$this->db->set('email', $this->input->post('email'));
$this->db->set('handphone', $this->input->post('handphone'));
$this->db->set('address', $this->input->post('address'));
$this->db->insert('tb_customer');

Please help me to fix this problem, thank you
Reply


Messages In This Thread
Problem with Insert Data into Sql Server's Table - by whalimkusuma - 08-25-2017, 08:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB