Put your connect string into a seperate script, if possible store it outside of the webserver root and include it whenever you need a connect.
1st advantage: You have only one place where you have adminitrate userid/password,
2nd advantage: Webuser can't access files outside webserver root directly
<?
// connect.inc.php
mysql_pconnect("localhost", "user","password")
?>
<?
// anyscript.php
include "/usr/local/wherever/connect.inc.php"; // Script needs a connect to the db
Another posibility is to define user, host and password at php.ini
; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =
; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo cfg_get_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =