-
-
Save ulyssesr/2085bc6d1a97e3b4d21688a35b112646 to your computer and use it in GitHub Desktop.
Simple PHP Script to connect to MySQL
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 | |
$username = "user"; | |
$password = "password"; | |
$hostname = "hostname"; | |
$database = "database"; | |
$dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); | |
echo "Successfully Connected to the MySQL Database.<br/>"; | |
$selected = mysql_select_db("$dbname", $dbhandle) or die("Could not select database"); | |
echo "Successfully Connected to Database called: $database"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment