In if…else condition, the else statement shows even if if statement is correct

In if…else condition, the else statement shows even if if statement is correct

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)