Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mysqli connect
#1
$host = "localhost";
$user  = "dbaccount_dbusername";
$password =  "xxpasswordxx";
$database1 = "dbaccount_database";
$database2 = "dbaccount_anotherdatabase";
$dbh1 = new mysqli($host, $user, $password, $database1);
if($dbh1->connect_errno > 0){
    die('Unable to connect to database' . $dbh1->connect_error);
}else{
    echo "Database dbname is connected.";
}
 
$dbh2 = new mysqli($host, $user, $password, $database2);
if($dbh2->connect_errno > 0){
    die('Unable to connect to database' . $dbh2->connect_error);
}else{
    echo "Database anotherdbname is connected.";
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)