I have the following:
[code]
$q = “set @fn = ‘/filmsdump.csv’;
select * from films where category_id = 1
order by 4
into @fn delimited by ‘,’;”;
echo “Running query <br>$q<br>”;
$qrslts = $pdo->query($q);
First time I have tried this and despite reading what I could find I’m getting this error:
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 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 ‘select * from films where category_id = 1 order by 4 into @fn delimited by’ at line 2 in /home/albany/public_html/homejg/test.php:18 Stack trace: #0 /home/albany/public_html/homejg/test.php(18): PDO->query(‘set @fn = ‘/fil…’) #1 {main} thrown in /home/albany/public_html/homejg/test.php on line 18
Can someone correct my attempt for me?