<?php
$db_host='localhost'; //server
$db_user='root'; //user name
$db_password=''; //password
$db_name='management'; //db name

function connect_db()
{
global $db_host,$db_user,$db_password,$db_name;
$link=mysql_connect($db_host,$db_user,$db_password );
if(!$link){
die('not connected:'.mysql_error());
}
$db_selected= mysql_select_db($db_name,$link);
if(!$db_selected){
die('error :'. mysql_error());
}
return $link;
}
?>