As said in my previous question I am having trouble loading data into my table through a csv file. The error I am getting is that the file is not found but it’s there. Could this be a WAMP issue i.e. permissions? You can find the code below along with the error.
Appreciate your help as always:
function load_table() {
global $wpdb;
$filename = 'upper_db_.csv';
$table_nme = $wpdb->prefix . "upper_winds";
$sql = "LOAD DATA INFILE '" . $filename . "'
INTO TABLE $table_nme
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY 'n'
";
$wpdb->query($sql);
}
File ‘c:wampbinmysqlmysql5.6.17datawp-testupper_db_.csv’ not found (Errcode: 2 – No such file or directory)
P.S. I have tried using backslashes, giving full path and I have also tried using the LOAD DATA LOCAL INFILE but to no avail.
Problem has been solved using the below
The plugin has now been completed and can be viewed at http://howtoflyahelicopter.com/aviation-weather-briefing/