Codeigniter Delete Query – how to run Delete Query in CodeIgniter

In this post we will show you how to execute CodeIgniter Delete Query with delete(), empty_table(), truncate() and Delete With Join.

CodeIgniter “Delete” query execute by following functions

  • $this->db->delete()
  • $this->db->empty_table()
  • $this->db->truncate()
  • Delete With Join

Codeigniter Delete Query with $this->db->delete()

In this functions of delete() we can delete data of user table with passing id. if we have to delete multiple table with same id, then it will very useful way to execute query.

bu An array of names of table can passed into delete(), if we would like to delete data from more than 1 table and single execution.

Codeigniter Delete Query with $this->db->empty_table()

by using empty_table() we can DELETE all data of table.

Codeigniter Delete Query with $this->db->truncate()

by using truncate() we can truncate table.

Codeigniter Delete Query with Delete With Join

by using “Delete With Join” we can delete data table like select join query in delete.

You also like codeigniter select query and codeigniter join tables