Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Simply_model extends CI_Model {
- function get($table)
- {
- $this->db->select();
- $query = $this->db->get($table);
- return $query->result_array();
- }
- function get_where($table, $id, $idtab)
- {
- $this->db->select();
- $this->db->where($idtab, $id);
- $query = $this->db->get($table);
- return $query->result_array();
- }
- function get_where_first_row($table, $id, $idtab)
- {
- $this->db->select();
- $this->db->where($idtab, $id);
- $query = $this->db->get($table);
- return $query->first_row();
- }
- function save($insert_data, $table)
- {
- $insert = $this->db->insert($table, $insert_data);
- return $insert;
- }
- function delete($table, $id, $idtab)
- {
- $query = $this->db->delete($table, array($idtab => $id));
- return $query;
- }
- function update($data, $table, $id, $idtab)
- {
- $this->db->where($idtab, $id);
- $update = $this->db->update($table, $data);
- return $update;
- }
- }
- /* End of file simply_model.php */
- /* Location: ./application/models/simply_model.php */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement