Created
November 18, 2013 09:16
-
-
Save abdullahbutt/7524960 to your computer and use it in GitHub Desktop.
CI_Active_Record_Delete Queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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