Created
October 29, 2014 09:46
-
-
Save peterentwistle/d350b7ff408688833da4 to your computer and use it in GitHub Desktop.
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 | |
$dbCon = mysqli_connect("localhost", "root", "yourpasshere", "tutorials"); | |
/* check connection */ | |
if (mysqli_connect_errno()) { | |
printf("Connect failed: %s\n", mysqli_connect_error()); | |
exit(); | |
} | |
/* check if server is alive */ | |
if (mysqli_ping($dbCon)) { | |
printf ("Our connection is ok!\n"); | |
} else { | |
printf ("Error: %s\n", mysqli_error($link)); | |
} | |
/* close connection */ | |
mysqli_close($dbCon); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment