I am playing around with php and mysql, trying to learn something. I have a small php page that uses this to collect ip adresses:
$ipaddress =$_SERVER['REMOTE_ADDR'];
I want to use the Ip to country database to correlate the Ip adress with a country. I have imported the country database. In trying to match Ip adress with data in the Country database I use this:
$result = mysqli_query($link,"SELECT countryLONG FROM IPCountry WHERE '". $ipaddress . "' BETWEEN ipFROM AND ipTO");
if (!$result)
{
$error = 'Error fetching country: ' . mysqli_error($link);
include 'included/error.html.php';
exit();
}
while ($row = mysqli_fetch_array($result))
{
echo $row['countryLONG'];
}
countryLONG is a field in the the IPCountry table with country names. ipFROM and ipTO are IP ranges. All I get is a blank page.