Displaying pages on an archive page

The issue turned out to be in another part of my code and nothing to do the the above query, which works just fine.

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