How to fix deprecated mysql_connect() warning

I recently moved one of my website to a new hosting, and got this warning:

mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

Well, you can remove the warning by adding a ‘@’ before the ‘mysql_connect()’ function like so:

@mysql_connect($db_host, $db_user, $db_pass)

That’s it!