0

In my controller, I am calling a model function with the following:

$this->sales_model->softdelete_order($this->input->post('ordernumber'));

what I want to do, in my model is

update Customer_Order_Summary set Deleted='1' where CustomerOrderID='123'

where 123 is $this->input->post('ordernumber')

My Model syntax is:

  function softdelete_order($q){
    $this->db->set('Deleted','1');
    $this->db->where('CustomerOrderID', $q);
    $query = $this->db->update('Customer_Order_Summary');
  }

This is not working or outputting any errors.

The model is preloaded and the post information is posting and echoing correctly so purely a model syntax issue I think.

Help appreciated as always.

Thanks,

4

2 回答 2

1

尝试使用

$this->db->set('Deleted',1);

如果不起作用,请发布您的确切错误

于 2013-05-10T09:46:25.507 回答
1

$query = $this->db->update('Customer_Order_Summary');

添加

$this->db->last_query();

查看您的查询,您可以从那里修复它。

于 2013-05-10T09:50:54.680 回答