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,

Smudger
  • 10,451
  • 29
  • 104
  • 179

2 Answers2

1

Try using

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

If not working post your exact error

bipen
  • 36,319
  • 9
  • 49
  • 62
asvignesh
  • 787
  • 2
  • 6
  • 32
1

After

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

add

$this->db->last_query();

to see your query and you can repair it from there.

bipen
  • 36,319
  • 9
  • 49
  • 62
Irwandi
  • 26
  • 2