Skip to content

Instantly share code, notes, and snippets.

@abdullahbutt
Created November 18, 2013 09:16
Show Gist options
  • Select an option

  • Save abdullahbutt/7524960 to your computer and use it in GitHub Desktop.

Select an option

Save abdullahbutt/7524960 to your computer and use it in GitHub Desktop.
CI_Active_Record_Delete Queries
Delete Queries
Delete queries are perhaps the simplest to describe. All you need is the name of the table and the ID number of the record to delete. Let's say I want to delete record in my sites table with the ID number 2:
$this->db->where('id', '2');
$this->db->delete('sites');
I get slightly nervous around 'delete' queries because they are so powerful. Please remember to make sure that there is a valid value in the 'where' clause, or you may delete your whole table! Neither the author nor Packt Publishing will accept any liability if….
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment