I have written a MySQL update statement which updates a table from a csv file. This command works perfectly when run from phpMyAdmin, but when trying to run it from php it fails. It says there is an error in my syntax.
This is my php code snippet
$file = "/root/location/to/file.csv";
$db = IEM::getDatabase();
$recover = "CREATE TEMPORARY TABLE temptable LIKE email_list_subscribers; LOAD DATA INFILE '$file' INTO TABLE temptable FIELDS TERMINATED BY ',' (emailaddress, subscriberid, confirmed); UPDATE email_list_subscribers INNER JOIN temptable on temptable.subscriberid = email_list_subscribers.subscriberid SET email_list_subscribers.confirmed = temptable.confirmed; DROP TEMPORARY TABLE temptable;";
$result = $db->Query($recover);
Any suggestions as to where I am going wrong?
the error message gets truncated to:
You have an error in your SQL syntax; check the manual that correspond...