I have a series of MySql queries that need to be called with PDO. Many of them are using MySql variables. Surely, a solution would be to use PDO prepared statements but that's not always the case. Insert
and Update
statements are running with no problems but Select
is throwing an error.
(I'm unable to paste it for you right now. Please say if it's necessary)
Select queries are running fine when executed in MySQL Workbench.
SET
@CY = YEAR(DATE_ADD(CURRENT_DATE,INTERVAL -17 DAY));
SELECT
*
FROM
TableX
WHERE
TableX.Year IN (@CY, @CY-1)
Any ideas?
Additional info: PHP 5.3.29
and MYSQL 5.5.47