The mysqli_change_user() function changes the user of the specified database connection, and sets the current database.
mysqli_change_user(connection,username,password,dbname);