This is first time I have tried to do this. I have a table defined and am trying to upload data from a text file through the PHP Admin interface.
I have some example csv text below. The data will only fill the first dozen or so fields and some other fields will be blank for now.
When I get anything at all to load it is just one row instead of the multiple rows I expect. One thing I am confused about is the field in the PHP Admin where it talks to the line ending in /r/n - Do I have to enter those in the text file? What is my text file line ending in?
Supposedly it loads 6 rows, but when it finishes only the last value is in the table, the other 5 are deleted -- I do have a primary key that is supposed to autoincrement called Userid. Would that be messing this up?
The SQL string that it says I am doing is:
Inserted rows: 6 (Query took 0.0035 sec)
SQL-query : [Edit] [Create PHP Code]
LOAD DATA LOCAL INFILE '/tmp/phpeBxkWi' REPLACE INTO TABLE Marketing
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\'
LINES TERMINATED BY '\r'(
First_Name ,
Last_Name ,
Title ,
Company ,
Address_Line_1 ,
Address_Line_2 ,
Address_Line_3 ,
City ,
State ,
Zip_Code ,
2nd_Address ,
Phone ,
Fax ,
Phone_1 ,
Phone_2 ,
Email ,
Web_Page
)
Here is some sample data:
"Karen","","","Women's Care","590 Country Club Parkway, Suite
B","","","Anytown","OR","77401-6038","","886. 2292","","","","",""
"Stephanie","Goerig","Optical Director","Sunset EYE Clinic","1865 NW 169 Place, Suite
105","","","Seattle","WA","98005","","(206)
553-8441","","","","goedg@hotmail.com","www.clinic.com"
"Jacob","Janecek","Optometric Physician","Sunset EYE Clinic","1865 NW 169 Place, Suite
105","","","Seattle","WA","98005","","(206)
553-8441","","","","jake@mail.net","www.someclinic.com"