How to delete a record in Codeigniter?

devquora
devquora

Posted On: Feb 22, 2018

 

In Codeigniter, delete function is used to delete the one or more row data from a table.
//DELETE FROM table WHERE id = $id
$conditions =['id' => $id]
$this->db->delete('table_name', $conditions); 

// Deleting records from more than one tables in one go
$id=1;
$tables = array('table1', 'table2', 'table3');
$this->db->where('id', $id);
$this->db->delete($tables);

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    CodeIgniter Interview Questions

    How to check the version of CodeIgniter framework?

    How to check the version of CodeIgniter framework?..