First you need to make a database from your admin panel. (hope you know to do that)

Then the following script would give the basic concept of connecting:

PHP Code:
<?php

$username 
"your_db_username";
$password "your_db_password";
$database "your_database_name";
$host "your_host_address";

$db_handle mysql_connect($host$username$password);
$db_found mysql_select_db($database$db_handle);

if(
$db_found){
     print 
"Auuraah You sucessfully connected!";
     
mysql_close($db_handle);
}else{
     print 
"ahh Try Again!!";
}
?>
shabbir like this