Link to home
Start Free TrialLog in
Avatar of Hidesign
HidesignFlag for United States of America

asked on

Importing data into serialized array in Wordpress

I have creating website for a basketball league. I used Formidable Pros for the front end registration and payments. I am now using sportpress pro to set up players, teams, schedules,etc. I created  a csv file that I was going to import in sportpresspro database but found out they are not using tables but postmeta data instead of tables. Is there a way to import my data into this array. Thanks
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Almost all plugins that store data will store it as key-value pairs in some meta table.  Formidable does this, Gravity does this, etc.

What you think of when you want to import is a single CSV into a vanilla row/column format table and obviously that won't quite work if the plugin has no import routine.  What you need to do instead is figure out the structure of the meta tables in play and run a series of imports via MySQL to fully upload your data.

For example, assuming the plugin creates a custom post type then you need to figure out what gets posted in the wp-posts table (probably the team).  From there do a simple insert query to add all teams to wp-posts and then extract the ID numbers.  From there you can build queries that create new rows in whatever tables are needed, making sure to include the post ID number when necessary.
Avatar of Hidesign

ASKER

Thanks - the plugin does come with an import feature but it only imports 7 set fields. I wanted other fields in addition so I don't have to retype them. I want to import the players with height, weight, grade and contact info. One of the preset fields is postion and I was thinking about putting the grade in that field if I can figure out how to change the text in the backend to say grade instead of position.

I was looking through the wp_postmeta table to see how it laid out. There is so much data that is not related to the players so I'm sure how to update.
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi - thanks for the info - I'm going through it and the code to see if I can get this working. I'm hoping I can get this data imported. Will take too long to key it all in