General error: 1 near "variation_length": syntax error (SQL: select * from "tests" where "published_at" is not null and "completed_at" is null and "visible" = 1 and start_date = DATE_SUB(NOW(), INTERVAL variation_length DAYS))
General error: 1 near "variation_length": syntax error (SQL: select * from "tests" where "published_at" is not null and "completed_at" is null and "visible" = 1 and start_date = DATE(DATE_SUB(NOW(), INTERVAL variation_length DAY))))
Would it be possible using some extension of parameter grouping do you know? E.g:
Either you have a different type of database or you may have one brace too many in the raw part, can you check that? Because i tried it myself and it should work.
General error: 1 near "SELECT": syntax error (SQL: select * from "tests" where "published_at" is not null and "completed_at" is null and "visible" = 1 and start_date = SELECT SUBDATE(NOW(), INTERVAL 1 DAY))
Seems like the same kind of error. I'm not sure what the problem is but it seems like a fundamental problem with the subdate function in my db :/
and got an error saying the NOW function doesn't exist
General error: 1 no such function: NOW (SQL: select * from "tests" where "published_at" is not null and "completed_at" is null and "visible" = 1 and start_date = DATE(NOW()))
You could extract this logic into its own class, make an interface and then have different implementations for MySQL and SQLite, but this is more advanced.
Else if you don't expect many records for this table, you could try filtering them through PHP