Welcome Guest, Not a member yet? Register   Sign In
[solved] How to detect database connection error?
#2

[eluser]Treeda[/eluser]
SOLVED :-)

sorry i was a bit too quick posting, i just found the solution myself.


for anyone who's interested in doing the same, just do at the very first beginning, your base controller or any other fitting entry point the following.

if the connection id (conn_id) is set, you've got a working database if not then... not

Code:
if ( $this->load->database('', true)->conn_id == false)
            print "error";
        else
            print "success";


Messages In This Thread
[solved] How to detect database connection error? - by El Forum - 07-10-2011, 04:44 PM
[solved] How to detect database connection error? - by El Forum - 07-10-2011, 04:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB