Stuck with conflicting loops on page template

Well for one thing I can spot that it seems your endwhile loop is closing OUTSIDE of a stray DIV tag. Try fixing that.

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