int mysql_change_user(string user, string password, string [database] , int [link_identifier] );
mysql_change_user() changes the logged in user on the current active connection, or, if specified on the connection given by the link identifier. If a database is specified, this will default or current database after the user has been changed. If the new user/password combination fails to be authorized the current connected user stays active.
Note that this function was introduced in PHP 3.0.13 and requires MySQL 3.23.3 or higher.