creating a csv to import data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

creating a csv to import data

Post by hame22 »

Hi I am creating a excel csv file to import some data into a table through phpmyadmin.

I have some questions regarding this.

In my excel file do I have to have a column for each table field, I am only inserting to half of the fields as the other half are automatically generated.

The table that I am importing into has a field which automatically generates a unique primary key - do I leave this field out from the csv?

I would appreciate any tips, thanks in advance
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

I remember phpMyAdmin being picky about CSV importing.

Export some data from phpMyAdmin as CSV and follow that format
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

This URL will also help you regarding loading csv and other text files.
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
Post Reply