Welcome Guest, Not a member yet? Register   Sign In
Implementing Pear library in CI
#1

[eluser]bhakti.thakkar[/eluser]
hi all,
i have integrated PEAR in CI. i have placed the required file in application/libraries/Dbconnect.php myDB connection is mentioned in this file. and entire pear folder in application/ folder
in autoload file i have autoloaded:
$autoload['libraries'] = array('session','Pearloader','dbconnect');

All is working file
i am able to work with pear functions well. but the only thing of concern is in every controller or model, while interacting to DB, i need to do this:
$conn = & $this->dbconnect->connect();

for example :
class Agency_Model extends Model
{

function __Construct()
{
parent::Model();
}

function get_all_agencys()
{
$conn = & $this->dbconnect->connect();


$sql = "SELECT Agency_code from Maritime_Agency";
$rs = $this->Dbconnect->getAll($sql, DB_FETCHMODE_ASSOC);
return $rs;
}

}

why do i need to mention the connect() function every time? i have autoloaded the library. where am i going wrong?

Thanks


Messages In This Thread
Implementing Pear library in CI - by El Forum - 09-10-2009, 05:12 AM
Implementing Pear library in CI - by El Forum - 09-10-2009, 06:23 AM
Implementing Pear library in CI - by El Forum - 09-10-2009, 11:07 PM
Implementing Pear library in CI - by El Forum - 09-10-2009, 11:52 PM
Implementing Pear library in CI - by El Forum - 09-10-2009, 11:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB