I have been trying to use the following query
$query_name = "LOAD DATA INFILE '"
. $file_path .
"' INTO TABLE '"
. $this->table_name .
"' FIELDS TERMINATED BY ','
LINES TERMINATED BY '\\n'
IGNORE 1 LINES
(time_stamp,curr_property,curr_property_cost,day_property,day_property_cost,curr_solar_generating,curr_solar_export,day_solar_generated,day_solar_export,curr_chan1,curr_chan2,curr_chan3,day_chan1,day_chan2,day_chan3)";
$this->db->query($query_name);
to upload my data into a database but the problem is that I am getting the following error
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin_tmp' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' ' at line 1
LOAD DATA LOCAL INFILE 'uploads/admin.csv' INTO TABLE 'admin_tmp' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES (time_stamp,curr_property,curr_property_cost,day_property,day_property_cost,curr_solar_generating,curr_solar_export,day_solar_generated,day_solar_export,curr_chan1,curr_chan2,curr_chan3,day_chan1,day_chan2,day_chan3)
I know that error 1064 is related to syntax but I don't see anything wrong with my code. Will be happy if someone could point out my mistake.