Edit file File name : User_model.php Content :<?php class User_model extends CI_model{ public function getusers(){ $query=$this->db->query("SELECT * FROM `users`"); return $query->result(); } public function select_data($id){ $query=$this->db->query("SELECT * FROM `users` WHERE id=$id"); return $query->result(); } public function insert_data($first_name,$last_name,$user_id,$password,$address,$contact_no,$alternate_contact_no){ $query=$this->db->query("INSERT INTO `users`(`first_name`, `last_name`, `user_id`, `password`, `address`, `contact_no`, `alternate_contact_no`) VALUES ('$first_name','$last_name','$user_id','$password','$address','$contact_no','$alternate_contact_no')"); return $this->db->insert_id(); } public function delet_user($id){ $query=$this->db->query("DELETE FROM `users` WHERE `id`=$id"); if($query){ return true; }else{ return false; } } public function update_user($id,$first_name,$last_name,$user_id,$password,$address,$contact_no,$alternate_contact_no){ $query=$this->db->query("UPDATE `users` SET `first_name`='$first_name',`last_name`='$last_name',`user_id`='$user_id',`password`='$password',`address`='$address',`contact_no`='$contact_no',`alternate_contact_no`='$alternate_contact_no' WHERE id=$id"); if($query){ return true; } else{ return false; } } } ?> Save