Changeset 375 for pro-violet-viettel/sourcecode/application/core
- Timestamp:
- Nov 3, 2014 12:25:15 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/core/MY_Model.php
r337 r375 30 30 { 31 31 $this->db->select('*')->from($this->table_name)->where($this->id_name, $id); 32 $query = $this-> get();32 $query = $this->db->get(); 33 33 if($query->num_rows() > 0) 34 34 { 35 35 $row = $query->row_array(); 36 return $row s;36 return $row; 37 37 } 38 38 } … … 43 43 return $query->result(); 44 44 } 45 46 function check_exist($data) 47 { 48 $sql="SELECT COUNT(".$this->id_name.") as total FROM ".$this->table_name." WHERE ".$data['field']." = '".$data['value']."' LIMIT 1"; 49 if ($this->db->query($sql)->row_array()['total']==1) 50 { 51 return true; 52 } 53 else 54 { 55 return false; 56 } 57 } 45 58 }
Note: See TracChangeset
for help on using the changeset viewer.