-
-
Save ron4stoppable/04d627bc74e220d0bed14761045940d3 to your computer and use it in GitHub Desktop.
Script for a quick PHP MySQL DB connection test.
This file contains hidden or 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 | |
# $ php -f db-connect-test.php | |
# a quick and easy script for db connectivity | |
$dbname = 'name'; // DB name | |
$dbuser = 'user'; // user name | |
$dbpass = 'pass'; // password | |
$dbhost = 'host'; // host | |
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); | |
mysql_select_db($dbname) or die("Could not open the db '$dbname'"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment