Edit file File name : Types_of_property_model.php Content :<?php class types_of_property_model extends CI_model{ public function get_types_of_property(){ $query=$this->db->query("SELECT types_of_property.*,users.first_name,users.last_name FROM types_of_property JOIN users ON types_of_property.updated_by = users.id"); return $query->result(); } public function selectdata($id){ $query=$this->db->query("SELECT * FROM `types_of_property` WHERE `id`=$id"); return $query->result(); } public function add_types_of_property($type,$updated_by){ $query=$this->db->query("INSERT INTO `types_of_property`( `type`, `updated_by`) VALUES ('$type','$updated_by')"); return $this->db->insert_id(); } public function delet_Types_of_property($id){ $query=$this->db->query("DELETE FROM `types_of_property` WHERE `id`=$id"); if($query){ return true; }else{ return false; } } public function update_data($id,$type,$updated_by){ $query=$this->db->query("UPDATE `types_of_property` SET `type`='$type',`updated_by`='$updated_by' WHERE `id`=$id"); if($query){ return true; }else{ return false; } } } ?> Save