Hi,
I have a table/model named News, with the fields date and modified,
being of the type datetime as it is cakephp convention.
Now I would like to paginate all News from a certain month. My first
approach to do this was:

$articles = $this->paginate('News',     array(  "News.created >=" => mktime
(0,0,0,$month,1,$year),
        "News.created <" => mktime(0,0,0,$month+1,0,$year)));

Unfortunately this does not seem to work, because the mysql field type
is datetime, which is a string and not a UNIX timestamp.
I think I will not be able to get the correct results for my query
when just comparing two date() generated strings either.

How should the query be written?

best regards,
Erik

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to