Thursday, 15 August 2013

php - Query to convert from datetime to date in zend framework 2 using table data gateway -


I just want to draw only dates from a datetime column in zend framework 2. I wrote it like this -

  $ select-> Where-> Middle ('date (views_logs.date)', '2013-01-01', '2013-03-31');   

To get the following results in the query.

  where date (`visual_logs` .`date`) '2013-01-01' and '2013-03-31'   

but this work Do not Generate Parasensis and Casting Is No Can I Help Writing Date Casting in Zend Framework 2?

I think you have to use expression there

  $ Choose- & gt; Where-> '2013-01-01' and '2013-03-31' ") between AddPredicate (New \ Zend \ Db \ Sql \ Predicate \ Expression (" Date (visible_logs.date) ");   

What error are you getting?

No comments:

Post a Comment