ADODB problem [Load Data Infile not executing] SOLVED

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
thomas777neo
Forum Contributor
Posts: 214
Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa

ADODB problem [Load Data Infile not executing] SOLVED

Post by thomas777neo »

Hi

I am trying to execute a "LOAD DATA INFILE ..." query using an ADODB connection.

Here is the query that I am trying to execute:

Code: Select all

LOAD DATA INFILE 'C:\\xampp\\xampp\\htdocs\\localamp\\modules\\billing\\importedFiles\\discovery.csv' REPLACE INTO TABLE discovery FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY ' \n' (member_no,dependents_no,name_last,initials,inception_date,effective_date,plan_type_id,ceb,vit,pty,contribution,msa,ancil,premium,split_amount,total_amount)
This is what I echoed to the screen (I inserted the \n by hand, if you echo it to screen it obviously jumps to a new line).

If I run the query in command line or in phpmyadmin it works 100%.

Here is the execution point in my code:

Code: Select all

$results = $connection->execute($sql);
$results equals NULL after execution, even if I intentionally put a syntax error in the SQL executed it still doesn't even throw an error. It is asif the ADODB doesn't even execute the query. Is it because the LOAD DATA INFILE syntax is not really a standard in SQL as a command to import data.
Post Reply