Double count view in archive.php

You fire setPostViews twice in ad.php

  1. via PHP setPostViews($adID);
  2. via JS with your ajax function again.

Remove one, and you should be fine.

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