Last active
December 14, 2015 19:58
-
-
Save jamesstout/5140274 to your computer and use it in GitHub Desktop.
connectToDBMYSQLI()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function connectToDBMYSQLI($dbConfig, $script, $die = true){ | |
$link = mysqli_connect($dbConfig['server'], $dbConfig['user'], $dbConfig['password'], $dbConfig['database'] ); | |
if (!$link) { | |
if($die == true){ | |
die("$script script Connect Error (" . mysqli_connect_errno() . ') ' . mysqli_connect_error()); | |
} | |
else{ | |
return false; | |
} | |
} | |
//echo 'Success... ' . mysqli_get_host_info($link) . "\n"; | |
return $link; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment