Pop up problem, help!

can i make the error message to pop up (“cannot connect”) and (“cannot select DB”), thx ^^

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB.");