Welcome Guest, Not a member yet? Register   Sign In
Check database connectivity.
#1

[eluser]Daniel Samuels[/eluser]
I'm attempting to build a site "wizard" where the user will enter various bits of information for a website.
The section I am currently working on is the database connectivity bit, the user will enter the following information:
- hostname
- username
- password
- database

What is the best way to check that the values are all correct?
Currently I am using this:
Code:
$connect = $this->load->database($config, TRUE);
if($connect->conn_id == ""){
    echo "Not connected.";
}
else {
    echo "Connected.'";
}

But I'm not overly confident with it.. Does anyone know a better way?

Thanks!


Messages In This Thread
Check database connectivity. - by El Forum - 02-28-2009, 09:03 AM
Check database connectivity. - by El Forum - 02-28-2009, 09:18 AM
Check database connectivity. - by El Forum - 02-28-2009, 09:20 AM
Check database connectivity. - by El Forum - 02-28-2009, 09:39 AM
Check database connectivity. - by El Forum - 02-28-2009, 09:46 AM
Check database connectivity. - by El Forum - 02-28-2009, 09:52 AM
Check database connectivity. - by El Forum - 02-28-2009, 09:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB