Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

SQL INTERVAL

hi,

this is my query

SELECT * FROM videos WHERE created_at < DATE_ADD(CURDATE(),INTERVAL -7 DAY) LIMIT 64

This works in phpmyadmin but with PHQL it not working

$weekvideos = $this->modelsManager->executeQuery("SELECT * FROM Videos WHERE created_at < DATE_ADD(CURDATE(),INTERVAL -7 DAY) LIMIT 64");
 $this->view->setVars(array('weekvideos' => $weekvideos));


44.7k
edited Dec '15

From the query object you can see the generated SQL with ->getSql()["sql"]. That usually clarifies everything.