<?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');if (!$link) { die('Not connected : ' . mysql_error());}$db_selected = mysql_select_db('database_name', $link);if (!$db_selected) { mysql_close($link); die ('Can not use selected database: ' . mysql_error());}echo 'Connected successfully';mysql_close($link);?>