retrieve post details in loop

First, change those = to === as mentioned by @sally-cj in the comment.

On top of that, you’re saving the status as a variable called $stat and are then checking it as $status. So you might want to change $stat = get_post_status($job->ID); into $status = get_post_status($job->ID);.

Or better: the $job is already populated with a field called post_status, so use $post->post_status.

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