Is it possible to load only the first 10 lines of a CSV file using MySQL - LOAD DATA LOCAL INFILE? I tried using LIMIT but did not work.
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 ";
source share