Hello,
It always returns all results - even if idis in the $ids array.
Where is the mistake?
$sql = "SELECT `id` FROM `views` WHERE `user_id` = '".$user_id."'";
$result = mysql_query($sql) OR exit(mysql_error());
$ids = '';
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_array($result)) {
$ids[] = $row['id'];
}
}
$sql = "SELECT `id`,`name`,`url`,`img`,`interval` FROM `ads` WHERE `id` NOT IN ('".$ids."')";
$result = mysql_query($sql) OR exit(mysql_error());