$suan = time(); $kontrol_sql = mysql_query("select id from program where mac_time<$suan"); while($row=mysql_fetch_array($kontrol_sql)) { mysql_query("delete from oranlar where mac_db_id='$row[id]'"); mysql_query("delete from program where id='$row[id]'"); }