I try to make this query with doctrine 1.2:
$q->where('date > ?',
new Doctrine_Expression('DATE_SUB(CURDATE() , INTERVAL 7 DAY)'));
but it’s not return me any results.
any idea ?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason why it doesn’t return anything is because Doctrine escapes the expression – the generated SQL is
rather than
You could force it to work like this:
This isn’t the safest option however, as the input doesn’t get escaped and isn’t good practice…