MySQL upload CSV file as new table

Posted by Brian on Stack Overflow See other posts from Stack Overflow or by Brian
Published on 2010-03-22T23:27:00Z Indexed on 2010/03/22 23:31 UTC
Read the original article Hit count: 208

Filed under:

I frequently upload CSV files to a MySQL db.

It is very convenient to use LOAD DATA LOCAL INFILE to upload the data, but I can't use this to create the table itself. As of now, the best method I have is to use PHP to get the field titles from the first row of the file and then put together a CREATE table query. Is there a more convenient way to do this?

© Stack Overflow or respective owner

Related posts about mysql