I want custom a few things in the library db...
And I created core system classes MY_DB in application/core folder:
class MY_DB extends CI_DB {
public function __construct() {
$CI =& get_instance();
$CI->load->database();
$this->db = $CI->db;
}
public function get($table = '', $limit = NULL, $offset = NULL) {
// my code custom...
$this->db->get($table, $limit, $offset);
}
public function insert($table = '', $set = NULL) {
// my code custom...
$this->db->insert($table, $set);
}
}
but apparently it does not work.
I want when I execute $this->db->get(), it will run the code I customized within class MY_DB.
If you just take a look at my problem and share a bit of your science, I'd be very grateful. Thanks!
$CI =& get_instance();and use$CI->db->get()$this->db->get()