You don't. Or, rather, if you do, then you also need to keep your encryption key in plain text right alongside the encrypted password, along with the algorithm (and initialization vector, etc.), so the net effect is that you've made things slower without actually accomplishing anything. You can store your password in a configuration file that lives outside of your public_html directory, where your script can get at it, but web users can't.
Please note that the mysql_xxx stuff is deprecated in the current version of PHP as well; you will need to use mysqli_xxx or PDO to avoid problems.