Can someone please help? I have been working on this for a couple of days now and still cannot seem to get a php script which imports a .csv file into an existing table.
The file imports just fine when i do it manually in phpmyadmin. I just dont know why writing the syntax into the php file makes it not work.
This is how each line in the .csv file is formatted (5 fields):
"Donald Jones","22 Bombay Ave,Springs,FL,32222","Apples",0.0,0.0
Here is what I put to get it to work manually in phpmyadmin:
Here is what my php has which doesnt enter the info into the table:
<?php
$conn = mysql_connect('xxxx','xxxx','xxxx');
mysql_select_db('ryanwoo_map');
mysql_query("TRUNCATE TABLE ryanwoo_map") or die(mysql_error());
mysql_query("LOAD DATA INFILE 'fruitlist.csv'
INTO TABLE ryanwoo_map(
name,
address,
fruit,
lat,
lng)
LINES TERMINATED BY '\r\n'
FIELDS TERMINATED BY ','
FIELDS ESCAPED BY '\'
ENCLOSED BY '\"'");
?>