Welcome Guest, Not a member yet? Register   Sign In
Check if database connection can be established
#1
Exclamation 

My application can be used with or without a database so I need to know if a database is correctly configured to show or hide functionalities which require a database.
How can I access to database config vars to check if they are filled?
Everything I found on the web requires to do a 
Code:
$this->load->database();

 so I can access to database vars from the 

Code:
$this->db

 object.

The problem is that if we do not have a database or if the database config file is not properly set, 
Code:
$this->load->database();

 will results in a PHP error:

Quote:Unable to connect to your database server using the provided settings.
Reply


Messages In This Thread
Check if database connection can be established - by Seb33300 - 01-30-2016, 10:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB