I am using the following
This is on a server with mysql version : 3.23.56 and PHP version: 4.3.10
But it only imports 1 row at best. If I take out the IGNORE 1 LINES option then it obviously inserts the header but for some reason it only ever imports 1 row. I change the LINES TERMINATED BY '\\n' to LINES TERMINATED BY '\\r\\n', Nothing get imported!! which is bizarre.
Any Ideas? is the order of the parameters important? I dont get any errors or anything. But I have been tearing my hair out over this for days. So please anyone.
This is on a server with mysql version : 3.23.56 and PHP version: 4.3.10
Code:
$sql = "LOAD DATA LOCAL INFILE 'xfile.txt' INTO TABLE `lettings` FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\\n' IGNORE 1 LINES;";
mysql_query($sql) or die('Error loading data file.<br>' . mysql_error());
Any Ideas? is the order of the parameters important? I dont get any errors or anything. But I have been tearing my hair out over this for days. So please anyone.
Comment