Server unreachable"); MYSQL_SELECT_DB($database) or die ( "

Database non existent

"); // Perform query on lat-long database $query = "SELECT countryLONG, ipREGION, ipCITY, ipLATITUDE, ipLONGITUDE FROM IPCITYLATLONG WHERE (ipFROM <= $IPnum) AND (ipTO >= $IPnum)"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Retrieve contents of query $row = mysql_fetch_row($result); // Close connection to lat-long database MYSQL_CLOSE(); // -------- IF NO MATCH CHECK SECOND IP-LAT-LONG DATABASE ----------------- // Check for zeroes if ( empty($row[3]) && empty($row[4])) { // Set parameters for lat-long SQL-server $server= "localhost"; /* Address of 1&1 database server */ $user= "dbo144306122"; /* Database username */ $password= "ndea43466872"; /* Database Password */ $database= "db144306122"; /* name of database */ // Connect to lat-long database MYSQL_CONNECT($server, $user, $password) or die ( "

Server unreachable

"); MYSQL_SELECT_DB($database) or die ( "

Database non existent

"); // Perform query on lat-long database $query = "SELECT countryLONG, ipREGION, ipCITY, ipLATITUDE, ipLONGITUDE FROM IPCITYLATLONG WHERE (ipFROM <= $IPnum) AND (ipTO >= $IPnum)"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Retrieve contents of query $row = mysql_fetch_row($result); // Close connection to lat-long database MYSQL_CLOSE(); } // Exit if still no match found if ( empty($row[3]) && empty($row[4])) exit; // -------- WRITE RECORD IN VISIT DATABASE -------------------------------- // Set parameters for map SQL-server $server= "localhost"; /* Address of 1&1 database server */ $user= "dbo144304509"; /* Database username */ $password= "ndea43466872"; /* Database Password */ $database= "db144304509"; /* name of database */ $table= "userlocations"; /* name of table */ // Connect to map database MYSQL_CONNECT($server, $user, $password) or die ( "

Server unreachable

"); MYSQL_SELECT_DB($database) or die ( "

Database non existent

"); // Insert record in map database $row[2]= addslashes($row[2]); $query= "INSERT IGNORE INTO $table (lat,lon,country,region,city) VALUES ('$row[3]','$row[4]','$row[0]','$row[1]','$row[2]')"; $result= mysql_query($query) or die('Insert failed: ' . mysql_error()); // Close connection to map database MYSQL_CLOSE(); ?>

IW Homepage Web Watch Resources Web Links Thought Leaders Site Search Contact Us
About Newsletter Contributors Multimedia Clips Futurepedia Podcast David Forrest's Blog
Join the Innovation Watch community... read and post in our online forums (coming soon) Innovation Forums
   My Innovation Watch  
 HOME
 My Innovation
 Watch
 

 

We're adding social bookmarking to Innovation Watch. Community members will soon be able to store and share links to resources on the web.

By tagging the links we will collaboratively create a folksonomy on change, innovation, the future, and emerging trends.

 
 
   
IW Homepage | Web Watch | Resources | Web Links | Thought Leaders | Site Search | Contact Us
About | Newsletter | Contributors | Multimedia Clips | Futurepedia | Podcast | David Forrest's Blog
Join the Innovation Watch community... read and post in our online forms: Innovation Forums
Send mail to webmaster (at) innovationwatch.com with questions or comments about this site.
Copyright © 2001-2008. Innovation Watch is a registered trademark.