In PHP, the old mysql extension has been officially deprecated in favor of either the MySQLi or PDO extensions (the latter presumably making use of the MySQLi API) for quite some time now. You should definitely be making the shift, which then also lets you make the shift to the use of prepared statements, as well as fully object-oriented database-related application code.
PS: Saying MySQLi is an alternative is sort of like saying IE 10 is an alternative for IE 7 or IE 8 -- MySQLi has more features and is more robust, so there's no good reason to stick with the old MySQL except possibly for backward compatibility on hopelessly behind-the-times servers.