Is it possible to only upload the first 10 rows of a CSV file using MySQL - LOAD DATA LOCAL INFILE? I tried using LIMIT but it’s not working.
Here is my PHP script:
$sql = "LOAD DATA LOCAL INFILE '".@mysql_escape_string($this->file_name).
"' INTO TABLE branches
FIELDS TERMINATED BY ',' ENCLOSED BY '\"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(
Name,
Address_Line_1,
City,
State,
Country_Code,
Postal_Code,
Main_Phone,
Google_Places_Link,
Custom_Directory_1,
Custom_Directory_2,
Custom_Directory_3,
business_id,
username
) SET branches.business_id=(".$this->business_id."), branches.username=('".$this->username."') LIMIT 0,10
";