I want to know how can I Echo ‘M’ with some sites only when the sites IP is in mass majority in the Database like if
12.43.121.2 IP is 9 times in 9 different sites then only it should echo ‘V’ with those sites having majority same IP if 14.821.83.21 IP is only 3 times with 3 different sites then it should not echo’M’ here is what i have tried but it’s all in vain
<?
$shm= mysql_query("SELECT * FROM data WHERE url='$od[url]'");
while ($getm = mysql_fetch_array($shm)){
if($getm['ips']=="$od[ips]"){
echo "V";
}
else{
echo"";
}
}
?>
Another Try
<?
$shm= mysql_query("SELECT COUNT FROM dom WHERE ips='$od[ips]'");
if($shm<3) ///Confused here what to do?// {
echo "V";
}
else{
echo"";
}
?>
My Final Code(Wordking) 🙂
<?
$shm= mysql_query("SELECT COUNT(*) FROM domain WHERE ips='$od[ips]'");
if($od['ips']=="")
{
}
else{
while ($getm= mysql_fetch_array($shm)){
$mass = $getm[0];
if($mass>"10"){
echo "V";
}
else{
echo"";
}
}
}
?>
This counts how many different urls are there in the database for each IP. The IP that is the most repeated IP, it’s echoed along with character ‘M’. You can adjust it to your needs.