<?php

class Api_model extends CI_Model {

    function __construct() {
        parent::__construct();
        $this->JH=$this->load->database('JH', TRUE);
    }

    function getAll($table,$where="1=1",$order="id desc") {
        $query = $this->JH->order_by("id desc")->get($table);
        return $query->result_array();
    }

    function _insert($table,$data){
        return $this->JH->insert($table, $data); 
    }
    function _update($table,$data,$where){
        return $this->JH->where($where)->update($table, $data); 
    }
}