• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Insert data return problem

#1
Hi, everyone
i have problem with return in insert data


Code:
$query_ins = $this->db->table('product')->insert($data);
if(!$query_ins){
return false;
}else{
return true;
}


the return value will always be true even if data fails to save

i appreciate any suggestions, thanks
Reply

#2
Try this in your model:

function order_summary_insert()
$OrderLines=$this->input->post('orderlines');
$CustomerName=$this->input->post('customer');
$data = array(
'OrderLines'=>$OrderLines,
'CustomerName'=>$CustomerName
);

$this->db->insert('Customer_Orders',$data);
}
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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