• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Connects Only Sometimes

#4
[eluser]Unknown[/eluser]
Thanks for replying. Before posting my issue, I had already set 'pconnect' to FALSE. I also gave 'autoinit' another try.

This is what my database.php file looked lilke before:

Code:
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '******';
$db['default']['database'] = 'database_one';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = FALSE;
$db['default']['stricton'] = FALSE;

$db['photo_portfolio']['hostname'] = 'localhost';
$db['photo_portfolio']['username'] = 'root';
$db['photo_portfolio']['password'] = '*****';
$db['photo_portfolio']['database'] = 'database_two';
$db['photo_portfolio']['dbdriver'] = 'mysql';
$db['photo_portfolio']['dbprefix'] = '';
$db['photo_portfolio']['pconnect'] = FALSE;
$db['photo_portfolio']['db_debug'] = TRUE;
$db['photo_portfolio']['cache_on'] = FALSE;
$db['photo_portfolio']['cachedir'] = '';
$db['photo_portfolio']['char_set'] = 'utf8';
$db['photo_portfolio']['dbcollat'] = 'utf8_general_ci';
$db['photo_portfolio']['swap_pre'] = '';
$db['photo_portfolio']['autoinit'] = TRUE;
$db['photo_portfolio']['stricton'] = FALSE;

Out of frustration and trying to debug, I modified the DB driver file to print out the $params that were being passed into the DB_driver.php file's constructor. With the $active_group set to 'default' and the 'photo_portfolio' DB set to autoinit, the params of the default database were being passed in. Is this intended or a bug?

After making the changes I just described, this is what changes have been made to the database.php file:

Code:
$active_group = 'default';
$db['photo_portfolio']['autoinit'] = TRUE;

Upon noticing that, I changed the active group to 'photo_portfolio' (which is the database I want to connect to. The problem doesn't seem to occur as often, yet it still occurs.


Messages In This Thread
Database Connects Only Sometimes - by El Forum - 07-22-2011, 03:31 PM
Database Connects Only Sometimes - by El Forum - 07-24-2011, 06:04 AM
Database Connects Only Sometimes - by El Forum - 07-24-2011, 11:45 AM
Database Connects Only Sometimes - by El Forum - 07-26-2011, 03:51 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.