import data via pods api duplicates records

0

After emptying a pods table, then using the api method to import a CSV file, the manage content section of the pods cms in wordpress duplicates records, so there's 2 of everything. I'd like to delete the duplicates. does anyone have a suggestion?

asked Jul 13 '11 at 11:04

fatpluto

1

add comment
enter at least 15 characters

3 Answers

0

To reset a Pod, use PodAPI like $api->reset_pod ( array('name' => 'your_pod_name') );

You will need to clear out the wp_pod records tied to that pod's "datatype_id" stored as wp_pod_types.id

answered Jul 15 '11 at 12:17

sc0ttkclark

2936

add comment
enter at least 15 characters
0

You could loop through all the records in your database and delete all but the oldest (or newest) using a PodAPI call.

answered Jul 15 '11 at 11:01

chris.pilko

889

add comment
enter at least 15 characters
0

@fatpluto,

If you meant to handle the duplicate records by deleting and leaving only one from each duplicate records, then try the following: http://www.openscriptsolution.com/2011/07/15/how-to-handle-duplicate-records-by-deleting-and-leaving-only-one-record-from-each-duplicate-records-in-mysql-database/

Hope it helps. :)

answered Jul 15 '11 at 4:05

Masino Sinaga

41

edited Jul 15 '11 at 4:06

thanks for the help. scott, I don't see reset_pod as a method under the user guide. What does it do? What does the first 'name' value represent? For clarity, the duplicate records do not occur in the table, just in pods / wordpress admin. it's probably b/c I'm emptying table contents directly, not through podAPI, and therefore, there's still a reference in the pod table. which is what I believe you are getting at scott, but I don't know how to go about clearing out the records tied to the datatype column. if anyone can provide me a bit more detail I'd really appreciate. thanks again! – fatpluto Jul 18 '11 at 5:24
@fatpluto - See http://podscms.org/codex/reset_pod – sc0ttkclark Jul 24 '11 at 9:24
add comment
enter at least 15 characters