Hi All,
I am trying to put the csv file data in mysql db.Now I have few questions like:
my csv file data format like this(in mysql table the UID is primary key and auto incremental, rest is like name,SID and phone.So there are total 4 fields):
name SID phone
aa 1 234
bb 2 456
Should I include UID as first column in the csv file or it will automatically generate the ids in the table.
1.Is it better to use “load data local infile” or use fgetcsv()
2.Next question is that the csv file may get updated frequently.So the csv file can be uploaded several times either with updated few rows or inserted new row along with the old rows.So i will first delete all the data and then insert with new one or is there any alternative way.i am not too much supportive to delete first and then insert.
for now I have these 2 questions.
Please suggest the best possible way.
Many thanks,
Raj