Before you can access data in a database, you must create a connection to the database.
In PHP, this is done with the mysql_connect () function.
Syntax:
<?php
$con = mysql_connect(""localhost"",""peter"",""abc123"");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}