<?php

include '../config.php';

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

$userArr = array();
$userArr2 = array();

foreach ($query as $veri) {

$userArr[] = $veri['user_id'];

}


$query2 = $db->query("SELECT * FROM sohbetler", PDO::FETCH_ASSOC);


foreach ($query2 as $veri) {

$userArr2[] = $veri['user_id'];

}

$userArr3 = array_unique($userArr2);


$newArr = array_diff($userArr, $userArr3);

//print_r($newArr);

shuffle($newArr);

$i = 0;

foreach ($newArr as $veri) {


$queryx = $db->query("SELECT * FROM kullanicilar WHERE user_id = '{$veri}'")->fetch(PDO::FETCH_ASSOC);

echo "<br><br>";
echo $queryx['user_id']. " = ".  $queryx['user_fullname']. " = ".$queryx['user_yas'];
echo "<br /><img src='../".$queryx['user_picture']."' style='max-width: 30%;'><br /><br />";
echo "####################################<br>####################################<br>####################################";


$i++;

if($i == 20){
	die();
}

}

?>


