Hi there,

I'm new to Doctrine and am trying to figure out why my Where statement
isn't working.

I have an object "video", and in my videoTable I have this function

public function getMostRecentVideos($num, $offset = 0) {
  return $this->createQuery()->where( 'Video.datetime_visible_start
<= ?', date('Y-m-d H:i:s', time()))
  ->orderBy( 'Video.created_at')
  ->limit($num)
  ->offset($offset)
  ->execute();
}

however the date filtering isn't working. I have seven test records,
one which has a datetime_visible_start which is a year in the future,
and yet when the code is run, it still returns that record.

For what it's worth, running

select * from video where datetime_visible_start < NOW();

in my mysql console returns the correct results.

I have Symfony 1.4.

I have scoured the internet, forums, symfony docs, doctrine docs,
doctrine code and irc but cannot find anything to help me do this; can
anyone shed some light on this please?

thanks
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to