I've successfully imported a file that includes access points in the area into my Etomite database (which I'm then going to use to generate a KML file).
The problem? I have a few duplicates within it.
The only unique thing that the software that I'm exporting from includes is the mac address (as no two are the same). It's possible to have two Access Point names the same, so I can't rely on that to find duplicates.
The problem is that not only do I want to filter the duplicates, I want it to delete the ones that've got the higher horizontalaccuracy number.
The software generates
<Placemark> <name> <![CDATA[zoom]]> </name> <description> <![CDATA[mac: 0:1:38:8d:e5:d2<br>channel: 10<br>MaxRssi: 4<br>Security: None<br>Type:Access Point<br>FirstSeen: 2009-03-17 11:37:42 AM +0000<br>LastSeen: 2009-03-17 11:37:55 AM +0000<br>HorizontalAccuracy: 80.651959]]> </description> <Point> <coordinates>-2.881937,54.062629,0</coordinates> </Point> </Placemark>
which after I've searched and replaced I manage to get 539 lines of the following, which I ran in phpMyAdmin... so now I've got all the data in the database.. you can see the fields I've used within the table in the queries.
INSERT INTO `lawifii_db`.`etomite_wifi` (`id` , `name` , `mac` , `channel` , `maxrssi` , `security` , `type` , `firstseen` , `lastseen` , `horizontalaccuracy` , `coordinates` ) VALUES ( NULL , 'zoom', '0:1:38:8d:e5:d2', '10', '4', 'NONE', 'AP', '2009-03-17 11:37:42', '2009-03-17 11:37:55', '80.651959', '-2.881937,54.062629,0' );
So can anyone tell me the php code I need to use to remove the duplicates that have the higher horizontalaccuracy number?

Sign In
Register
Help

MultiQuote