Php code for connecting to a MySQL Database
Here is the Php code for connecting to MySQL Database
$mysql_hostname = "mysqlserver";
$mysql_user = "mysqlusername";
$mysql_password = "mysqlpassword";
$mysql_database = "mysqldatabase";
set_time_limit(6000);
$sn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $sn);
The last two lines are important as they connect to MySQL Database using Username,Password,hostname and Database
Here Mysqlserver,mysqlusername,mysqlpassword,mysqldatabase should be replaced by your own values