[eluser]dev.bashar[/eluser]
Code:
<?php
class user_model extends CI_Model {
public function test()
{
$specific['hostname'] = "localhost";
$specific['username'] = "myusername";
$specific['password'] = "mypassword";
$specific['database'] = "mydatabase";
$specific['dbdriver'] = "mysql";
$specific['dbprefix'] = "";
$specific['pconnect'] = FALSE;
$specific['db_debug'] = TRUE;
$specific['cache_on'] = FALSE;
$specific['cachedir'] = "";
$specific['char_set'] = "utf8";
$specific['dbcollat'] = "utf8_general_ci";
$this->load->database($specific);
//get data
$o = new db_user();
$array = array();
$o->where($array)->get();
echo $num_rows = $o->result_count();
}
}
?>
this is my test code
when i call function from controller
Code:
public function calldatabase()
{
$user_id = $this->user_model->test();
}
it's still connect with main database
and it's didn't print wrong database connections ...
can you help me please