0

I am using codeigniter and I was having a problem in .htaccess file then when the site opened an error appear:

A Database Error Occurred Unable to connect to your database server using the provided settings. Filename: core/Loader.php Line Number: 346

I searched for the solution and I get that:

database.php file:

$db[‘default’][‘db_debug’] = TRUE change it to $db[‘default’][‘db_debug’] = FALSE

It works to open the view files but no action with database it gives an error and another solution that didn't work was database file: $db['default']['pconnect'] = TRUE; set to false.

Shaiful Islam
  • 7,034
  • 12
  • 38
  • 58
Samer Essam
  • 25
  • 1
  • 5

2 Answers2

0

If you have you application online, you need to hide DB errors because of security reasons. Change DB config to:

$db[‘default’][‘db_debug’] = FALSE;

If you are in development mode, you can use Profiler to check every query and everything. Just add this in controller:

$this->output->enable_profiler(TRUE);

And for pconncet, you have a good explanation here

Community
  • 1
  • 1
Erman Belegu
  • 4,074
  • 25
  • 39
0

When you set $db[‘default’][‘db_debug’] = FALSE It means it hides your database errors but It does not mean your database errors will solve.

The error message you got says the real reason what problem you are getting

Open your config/database.php and check the database credential(hostname,username,password,database,dbdriver and may be others) you provided is OK.The error message says they are not OK.

Shaiful Islam
  • 7,034
  • 12
  • 38
  • 58