Created
July 9, 2015 08:37
-
-
Save dmacompton/b252daa5dfd8da28f1fb to your computer and use it in GitHub Desktop.
Revisions
-
dmacompton created this gist
Jul 9, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php class Model_admin extends CI_Model { // UPDATE function updateTable($table, $dbins, $where=FALSE) { if($where) $this->db->update($table, $dbins, $where); else $this->db->insert($table, $dbins); } // REMOVE function removeFromTable($table, $where=FALSE){ if($where) $this->db->where($where)->delete($table); else $this->db->empty_table($table); } } ?>