Skip to content
saturngod edited this page Feb 2, 2012 · 9 revisions

Load Database

$this->db->load('db');
$this->db->get('table');

Automatically load

in system/config/development.php ( for production : system/config/development.php )

public static $autoload=array("db");

SELECT

SELECT id FROM *table*

code will be

$result = $this->db->select('id')->get('table');
if($this->db->count > 0) {
    echo $result[0]->id;
}

Clone this wiki locally