[wp-hackers] Storing Tabular Content in the Database

Mohammed K. al-Safi msafi at msafi.com
Tue Feb 17 18:02:39 GMT 2009

My question is about allowing WordPress users to easily display tabular
content on their blog; providing them with tools to easily do so.

I'm creating a plugin that will ask the user to select a CSV file from their
HDD and then store the content of this CSV file, *some how*, and display it
as HTML on a page or a post. I know, there already is a plugin by Alex Rabe
called wp-Table. However, I believe there is plenty of room in this area for
another plugin.

At any rate, I need your help on how I should store the tabular content that
the user uploads via this plugin.

My first thought was to take a CSV file and create a new MySQL table that
mirrors the CSV file. So, for every CSV file the user wants to display on
the blog, I'd end up with a corresponding MySQL table in WP's database. I
would also create a table to keep track of these CSV tables.

I explained the aforementioned implementation to some people on irc://
irc.freenode.net/mysql and they said that this is definitely not the way to
do it. They were talking about database schemas, data normalization and some
stuff that, honestly, I don't think is practicable or applicable for this
plugin. But the people in the IRC channel didn't really understand the
situation as well as you would, so I want your opinion and help.

As an alternative solution, I thought that maybe I will generate the HTML
for the table, and just store that. Kind of like how WordPress would store a
post or something...

Which implementation should I follow?


More information about the wp-hackers mailing list