Post URL not working according to permalink setting

Are you using $post->guid or something like that? If so, then the GUID give you this kind of URL. Otherwise you can use get_the_permalink( $post_id )

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