My codeigniter is using another database instead of the one I selected

Asked

Viewed 26 times

0

I have 2 projects, one is the copy of the other, one I want to leave online and the other test for me to program on top, so I copied the database and copied the project, changed the name, changed the directory, and put the 2 on the same server, but my test project insists on using the old database, no matter how much in the.php database the new database is. I’ll send you what’s in the database.php, this matches the database of the original file:

$db['sas'] = array(
'dsn'   => '',
'hostname' => 'MyServerIp',
'username' => 'sas',
'password' => '******',
'database' => 'sas',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => FALSE);

And this is in the.php database of the test project:

$db['sas'] = array(
'dsn'   => '',
'hostname' => 'MyServerIp',
'username' => 'sastest',
'password' => '************',
'database' => 'sasClone',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => FALSE);

In the applications I call the bank as follows:

$dbsas = $this->load->database("sas", TRUE);

I hope I was clear, my project is using a different database than the one in the.php database.

  • What is the database name he uses on his own?

  • It’s not being clear because the key names are the same... which is why you’re not getting the bank properly

  • They are different systems, the name of the key may be the same but they are 2 database.php different, the test system that is the copy of the first, even though in the database.php references the sasClone, it ends up using the normal sas.

1 answer

0

I’ve found the problem, sorry folks, it was a problem with Routes, apparently it calls normal system function instead of test

Browser other questions tagged

You are not signed in. Login or sign up in order to post.