One easy alternative to the MySQL extension is MySQLi. Instead of
mysql_connect("host", "username", "password")
... you could connect using e.g.
$db = mysqli_connect("host", "username", "password");
It's probably worth reading this helpful tutorial:
http://phpmaster.com/avoid-the-original-mysql-extension-1/