Created
July 3, 2014 18:35
-
-
Save manfromanotherland/4ae17a866d6fe4948da0 to your computer and use it in GitHub Desktop.
PHP: How to test connection to database #snippet
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 | |
$mysqli = @new mysqli('host', 'user', 'password', 'dabatase'); | |
if ($mysqli->connect_errno) { | |
die('Connect Error: ' . $mysqli->connect_errno); | |
} | |
echo "Connected successfully" | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment