you missed some stuff
<?
//set the variables as required
$dbhost = \"mysite.com\";
$dbuser = \"username\";
$dbpass = \"password\";
$dbname = \"database_name\";
//do not edit this, it connects the script
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname) or die(mysql_error());
?>
<\'s are nice in front of a php tag :P
also the or die is for security reasons and is helpfull