Most likely you don't have the php_mysql extension installed, so it doesn't understand what you're trying to do. To be sure about that, check your web servers error log. It should tell you why it didn't parse the page.
But as Quentin already mentioned in the comments, the mysql extension has been deprecated for quite a while now. Try installing the MySQLi or PDO extension and use that instead. PDO is more flexible and offers prepared statements support, so I'd suggest that.
So, install the PDO extension on your server (see the documentation for more details). And then connect using something like this instead:
$dbh = new PDO('mysql:host=localhost;dbname=test', 'user', 'pass');
This will connect you to the test
database on your localhost. More information can be found in the PHP docs here.