[eluser]Dennis Geus[/eluser]
Hi all,
I'm uploading a .csv file and then insert the data into a temp table in the database.
I'm using the following piece of code:
Code:
$path = './uploads/';
$file = $upload_data['file_name'];
$fieldterm = ";";
$lineterm = "\\r\\n";
$this->db->query("LOAD DATA LOCAL INFILE '".$path.$file."' INTO TABLE temp FIELDS TERMINATED BY '".$fieldterm."' LINES TERMINATED BY '".$lineterm."' IGNORE 1 LINES");
It ends up with the following error:
Quote:A Database Error Occurred
Error Number: 0
LOAD DATA LOCAL INFILE './uploads/export_uit_sap7.csv' INTO TABLE temp FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' IGNORE 1 LINES
Filename: G:\Inetpub\development\qc\system\database\DB_driver.php
Line Number: 330
But when I check the temp table it is filled with the data of the csv file.
in my logfile i find this line:
Quote:Severity: Warning --> mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set G:\Inetpub\development\qc\system\database\drivers\mysql\mysql_driver.php 163
After a few hours of searching I think I can't find it.
If someone can point me to the right direction or can come up with a workaround i would appreciate it.