How to add Pagination to foreach loop to page

Add this argument to your WP_Query.

'paged' => get_query_var( 'paged' ),

And use a array style of arguments rather than a query post style.

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