Welcome Guest, Not a member yet? Register   Sign In
Share my DB class for CI
#1

[eluser]vps4[/eluser]
It's simple and useful MySQL DB class.
I modify it from WordPress2.5.1 wp-db.php

It also automatic load DB config from CI config file.

Usage:

just put it in your CI app library folder, usually in system/application/libraries
and name Db.php

now , you can load the library anywhere, or set it automatic load in autoload config file
Code:
$this->load->library('db');

these method is better than CI database, only ONE line code.
Code:
$this->db->get_var($sql);
$this->db->get_row($sql);
$this->db->get_col($sql);
$this->db->get_results($sql);

enjoy it!!!

I can't post the code to here, because it's so long

please get it from

http://www.21andy.com/blog/20080607/1156.html

anyway, sorry for my poor english.




Theme © iAndrew 2016 - Forum software by © MyBB