From what I've seen, variables can be a little testy sometimes in PHP script. I would try not defining quite so much of the script. Instead perhaps use
PHP Code:
<?php
$db = 'scorecard';
$conn = mysql_connect("localhost", "root", "xyz");
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
?>
You were also missing a bracket on your "if" statement, that could be the issue.
If neither of those fixes work, I would double check and make sure that the account information you are using is correct and that the user that you have named has the proper permissions to access the database you are trying to connect to.
Hope that helps a little!