I have the following code that is supposed to check through each IP address, but is instead combining everything and making the code useless.
$query = "SELECT ip FROM user_db where active=0";
/* execute the query */
$qid = mysqli_query($connection, $query);
$num_rows = mysqli_num_rows($qid);
$i=0;
while ($i < $num_rows) {
$row = mysqli_fetch_array($qid,MYSQLI_ASSOC) or die(mysql_error());
$hit_ip=$row['ip'];
if($hit_ip==$ip){
header("Location: http://www.someothersite.com");
}
$i++;
}
$hit_ip is every address in a single string. I need each address to be compared on it's own. Can you spot the mistake, and how do I remedy it?