PHP Connect with Database

Php simply connect to a database.

PHP Database Connection

<?php
$username = “username”;
$password = “password”;
$hostname = “localhost”;

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die(“Unable to connect to MySQL”);
echo “Connected to MySQL”;
?>

Leave a comment