If can't connect to the database, you now close to solving your problem, just recheck your database detail.
Remember to follow the structure below:
host = 'localhost';
$user = 'hostingaccountusername_databaseusername';
$password = 'yourdatabasepassword';
db = 'yourdatabasename