=INET_ATON('$remoteAddr') "; // Executing above query $country_exec = mysql_query($country_query); if($country_exec == FALSE) { $country_code = ""; $country_name = "UNKNOWN"; } else { // Fetching the record set into an array $ccode_array = mysql_fetch_array($country_exec); // getting the country code from the array $country_code = $ccode_array['country_code2']; // getting the country name from the array $country_name = $ccode_array['country_name']; } // Closing the database connection mysql_close($dbh); return Array( 'CountryCode' => $country_code, 'CountryName' => $country_name); } ?>