JSON format
-
We have over 20k rows of data in Tablepress currently and expect to import thousands of rows of data each month. Using the built in Import is too slow and does not have any kind of error checking for our data (of course not, how could tablepress possible know of our data validation needs? 😉 So using import files is not an option for us.
In an effort to speed things up and ensure our data is validated before importing, I am designing a program to read the data from a spread sheet and update the MySQL table directly. In order to do that, I must first read in the current data from MySQL and parse it. That part I have working so far. The trouble I am having is when I go to save the date back to MySQL, I must first serialize my data and the JSON lib I am using formats it differently than Tablepress.
Example: Tablepress formats the JSON like this:
[[“col1”, “col2”, “col3”],
[“test1”, “test2”, “test3”],
[“dog”, “cat”, “bird”]]JSON serializer I am using formats the JSON like this:
[{“col1″:”test1″,”col2″:”test2″,”col3″:”test3”},
{“col1″:”dog”,”col2″:”cat”,”col3″:”bird”}]My question is: will TablePress be able to understand and use the second JSON format (which I understand from my searches on the internet to be the “official” way to do JSON)? If not, do you have any recommendations or code samples for how to format the JSON so that TablePress can understand and use it?
Thank you!
The topic ‘JSON format’ is closed to new replies.