[eluser]maria clara[/eluser]
[quote author="cahva" date="1266844929"]Do not remove it from function attribute. Remove it from $this->db->delete
Code:
// original
$this->db->delete('maint_company',$data);
// remove $data
$this->db->delete('maint_company');
Same goes for the other $this->db->delete[/quote]
ahh ok got it. i have this code now. but it still not deleting the record. and it was not deleted also in the database
model:
Code:
function delete($data) //Query function use to delete detail user
{
// Below equals DELETE FROM maint_company WHERE company_id = [company_id]
$this->db->where('company_id', $data['company_id']);
$this->db->delete('maint_company');
// Below equals DELETE FROM sec_companyaccess WHERE user_id = [user_id] AND company_id = [company_id]
//$this->db->where('user_id', $data['user_id']);
$this->db->where('company_id', $data['company_id']);
$this->db->delete('sec_companyaccess');
}
controller:
Code:
case $crudConfig['delete']:
$data['table_name'] = $crudTableName;
$data['company_id'] = $this->input->post('id'); // and make sure you are posting this data
//$data['user_id'] = $this->input->post('user_id'); // and make sure you are posting this data
$this->User->delete($data); //<----- need to pass the company data, the user id, and the table name to the query
}