How to use WP_Query() on single.php?

$query->the_post;

should be:

$query->the_post();

The first is trying to fetch a property named the_post rather than invoking the function so the post never advances, and your loop is infinite.

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