You cannot create a mysql database using a csv file, you have to first create the database manually.
Once you did this, you can use phpmyadmin's "Insert data from a text file into the table" function. I don't know about the pictures part but this should do the trick. Excell databases are tricky.
try this:
Quote:
phpMyAdmin easily allows you to import whole tables of data in comma-separated or tab-separated format. Just look for the "Insert textfiles into table" link when you are viewing a table's properties.
This of course means that you have to create the table first, before you import the data to fit into the columns.
So it goes in this order:
1) create table with exactly the same number of fields as your Excel sheet.
2) make sure those fields have the right datatype to accept the data in the related columns in the spreadsheet.
3) Save as comma-separated .CSV or tab-separated .TXT file in Excel (I recommend tab-separated, because excel is a little weird sometimes about what it surrounds with quotes and what it doesn't. Be careful about having tabs inside your data, though)
4) View your table properties in phpMyAdmin, click on "Insert textfiles into table",
a. Set "Fields terminated by" to \t (for tab-delimited) or , (for comma-separated)
b. Set "Lines terminated by" to \r\n
c. click on "Browse" and upload your file.
I'm sure you noticed the "Fields enclosed by" and "Optionally" choices. The only caveat with Excel-to-MySQL is that Excel will only enclose cells with quotes IF the field separator (comma or tab) occurs within that cell's data, so it's kind of willy-nilly. MySQL either expects ALL fields to have quotes, or (Optionally) all Text fields to have quotes. If your data is too complex, you might have an easier time copying it into an Access table, because Access gives you more control over output to text/CSV.
|
good luck