<?php
include('include/connect.php');
date_default_timezone_set('Europe/Istanbul');
$zaman 	   = date("Y-m-d");

$zamansor = $conn->query("SELECT * FROM uyeler WHERE durum = 'Yayında' AND btarih <= '$zaman' ORDER BY id ASC");

while($zamanyaz = $zamansor->fetch()){

$guncelle = $conn->prepare("UPDATE uyeler SET durum = ? WHERE id = ?");
$guncelle->execute(array( 'Pasif' , $zamanyaz['id'] ));

}
?>