In this case, @ will suppress the usual PHP database connection error (which may contain sensitive information). In case of a connection error, the "or die" part will be executed, otherwise with a general error message. The string is probably copied from a "quick and dirty" example.
Using the error suppression operator @ is considered bad style, especially when there are no other forms of error handling. This complicates the debugging - how can you find out about the error without any indication that this happened? In a production system, it is better to write all errors to a file and suppress the display of errors on the page. You can do this in the php.ini or (if you are on a shared host and cannot change the configuration) with the following code.
ini_set('display_errors', false); ini_set('log_errors', true); ini_set('error_log', '/var/log/apache/php-errors.log');
source share