Results 1 to 13 of 13
Nov 17, 2011, 14:01 #1
- Join Date
- Aug 2008
- 0 Post(s)
- 0 Thread(s)
How to Delete All Duplicated Records
I have a Wordpress site where I've added functionality to show the location of users who've posted to the site.
I'm using Google's geomap API to generate lat & lng coordinates. But I must've coded something wrong, because I'm getting 2 or 3 sets of coordinates for every location, and a ton of duplicates for each.
I first need to clean the duplicates out the database, but I'm unsure how to go about this. What complicates things additionally is how this particular Wordpress table (wp_postmeta) is built.
The table columns are meta_id, post_id, meta_key and meta_value.
meta_id is the pk, post_id is the fk back to the actual post, meta_key holds my values that define my meta_values data like "latitude" and "longitude", and meta_value holds the actual data like 33.6839473 .
Combining the post_id and meta_key values will provide a unique identifier. Any records with duplicate values should be removed.
If anyone could provide me some ideas or related examples it would be greatly appreciated. Thanks!