Changeset 8989
- Timestamp:
- Mar 25, 2011, 3:51:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/db/csv_to_db.php
r8986 r8989 2 2 3 3 // edit with personal settings 4 $location = ' 5 $username = ' 6 $password = ' 7 $database = ' 4 $location = 'localhost:3306'; 5 $username = 'root'; 6 $password = 'dsql'; 7 $database = 'project_heatmap'; 8 8 9 9 $filelist = array(); … … 46 46 $lat=str_replace("N ", "", $data[0]); 47 47 $lon=str_replace("E ", "", $data[1]); 48 $ssid=str_replace("'", "", $data[2]); 48 49 $enc = substr($data[8], -2, 1); 49 50 echo "\"".$lat.", ".$lon."\", \"".$data[2]."\", \"".$data[4]."\", \"".$enc."\"<br />\n"; 50 $query=mysql_query("INSERT INTO ".$table." (latitude, longitude, ssid, mac, encryption) VALUES ('$lat','$lon','$ data[2]','$data[4]','$enc')");51 $query=mysql_query("INSERT INTO ".$table." (latitude, longitude, ssid, mac, encryption) VALUES ('$lat','$lon','$ssid','$data[4]','$enc')"); 51 52 if (!$query) { 52 53 die('Invalid query: ' . mysql_error());
Note:
See TracChangeset
for help on using the changeset viewer.