re:PHP <> MySQL on Win2k Advanced server not returning r



Manually the IP is there. I am using the code as described above to
ensure I do not get a negative. here is a copy of my code, perhaps
you can see something I cant!

I am going to try and re-install the CSV file and see if that makes a
difference

<?
/*
Country SQL init code
*/


function GetCountryInfo($ip)
{
/* Include Database Params */

include "deploy-db.inc";

$ip = sprintf("%u", ip2long($ip));
$ci=array('COUNTRY_NAME' => 'Unknown', 'COUNTRY_CODE2' =>
'--', 'COUNTRY_CODE3' =>'---' , 'number' => '000','flag'
=>"NOFLAG");


$connect = mysql_connect($db_host,$db_user,$db_pass);
$select = mysql_select_db($db_name, $connect);

//$sql="SELECT IP_FROM, IP_TO, COUNTRY_CODE2, COUNTRY_CODE3,
COUNTRY_NAME FROM $country_table WHERE IP_FROM <= $ip and IP_TO
>=$ip LIMIT 0, 1;";
$sql="SELECT IP_FROM, IP_TO, COUNTRY_CODE2, COUNTRY_CODE3,
COUNTRY_NAME FROM $country_table WHERE $ip BETWEEN IP_FROM AND IP_TO
LIMIT 0, 1; ";

$query =mysql_query ($sql,$connect);

if($row = mysql_fetch_row($query))
{
$ci['COUNTRY_NAME']=$row[4];
$ci['COUNTRY_CODE2']=$row[2];
$ci['COUNTRY_CODE3']=$row[3];
$ci['flag'] = $row[2];
}
return $ci;
}
?>

.



Relevant Pages

  • Re: Import txt file
    ... sorry that my english is poor, and it was make you cant understand what i'm ... i have a csv file which is export from ubs. ... "Jeff Boyce" wrote: ... Microsoft Office/Access MVP ...
    (microsoft.public.access.externaldata)
  • Internet Explorer 6 settings
    ... minimised so I could switch between them, now if I click on a link to ... another site it opens in the same window and I cant even click back to the ... I've tried changing the IE settings but nothing has worked. ... Prev by Date: ...
    (alt.os.windows-xp)
  • Re: need urgent help! please someone help?!
    ... anyway i can clear my c: drive in dos/command prompt and re-install ... but cant find any simple websites... ... use Google Groups Advanced Search and search ... MS-MVP Windows - Shell/User ...
    (microsoft.public.windowsxp.general)
  • Open Mail Merge from button on Access 2003
    ... will open Word and the mail merge document automaticly, and cant seem to find ... I am currently using Office 2003 with Windows XP is that changes anything ... Prev by Date: ...
    (microsoft.public.access.externaldata)
  • Re: everything in my word program in locked down it seems...
    ... Please respond in the newsgroups so everyone can follow along. ... i cant add, copy, delete, no ... > command is working.. ... Prev by Date: ...
    (microsoft.public.word.docmanagement)