I have CSV file with header and data fields. How can I insert this via SQL query and remove headers. At the moment code that I wrote is working, but it is inserting header as a data into DB.
The code:
$files = directory_map('./assets/csv/');
foreach ($files as $file) :
$filefile = './assets/csv/' . $file;
$q = "LOAD DATA LOCAL INFILE '$filefile' INTO TABLE person FIELDS TERMINATED BY ','
LINES TERMINATED BY '
' (personal_name, personal_lastname,
personal_country,personal_address,contact_email,dateadded);";
$this->db->query($q);
endforeach;