Search code examples
phpmysqlcreate-tableimport-from-csv

CSV Table Upload for Article


I have an articles website in PHP/MySQL. What I want to allow someone to do is to upload a CSV file and have that appear as a table within the article itself. I want to avoid doing a CREATE table every time as I could easily end up with thousands of tables.

Thoughts on the best way to store table information like this efficiently and permanently?


Solution

  • Unless you're going to want to manipulate the data later on, it would probably be much easier just to convert the CSV file contents to a HTML table and store it as part of the article html. A simple search for csv to html table returns many, many prewritten functions, some in php; check them out.