<?php 

include '../../config.php';

$aralik = time()-2592000;


$query = $db->query("SELECT * FROM kullanicilar WHERE user_songiris <= $aralik AND user_bot = 0", PDO::FETCH_ASSOC);

$mesajsayi = 0;

echo "DELETE FROM sohbetlog WHERE user_id = 1 OR ";

foreach ($query as $veri) {


	$user_id = $veri['user_id'];

echo "user_id = ".$user_id." OR ";

/*	$query2 = $db->query("SELECT * FROM sohbetlog WHERE user_id = $user_id", PDO::FETCH_ASSOC);

echo $query2->rowCount();*/

	//$delete = $db->exec("DELETE FROM sohbetlog WHERE user_id = $user_id");

/*	$mesajsayi = ($mesajsayi+$query2->rowCount());*/



}

//echo $mesajsayi." Mesaj Temizlendi!";


?>