Trying to load a CSV into a MySQL database. Can't get it to work...
SQL Query =
$query = "LOAD DATA LOCAL INFILE `$ptempName` INTO TABLE `students` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r' ESCAPED BY ',' ENCLOSED BY '" . '"' . " ('StudentNumber', 'FirstName', 'LastName' , 'Gender' , 'Year', 'Email', 'DOB', 'Phone', 'Notifications');";
$result = mysql_query($query)or die ('Error: '.mysql_error ());
Error: 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 '` INTO TABLEstudents` FIELDS TERMINATED BY ',' LINES TERMINATED BY ' ' ESCAP' at line 1