Try

1 - 'Event.datefield>=now()'

2 - 'Event.datefield>=now() AND Event.datefield<DATE_ADD(now(),
INTERVAL 1 WEEK)'

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net



On 8/9/07, CakeMan <[EMAIL PROTECTED]> wrote:
>
> Hello friends,
>
> I am having 2 dates issue while working in cakephp. I have two tables
> events_categories and events.
>
> IN one part
>
> I want to show the events according to the event_categories so i have
> put this code in event_category model
>
> var $hasMany = array('Event' =>
>                         array('className'    => 'Event',
>                               'conditions'   => '',
>                               'order'        => '',
>                               'dependent'    =>  true,
>                               'foreignKey'   => 'event_category_id'
>                         )
>                   );
>
> This is working fine. Now what i want is to show only those events
> that are in the future i.e. on & after the current date. For that i
> using this
>
> var $hasMany = array('Event' =>
>                         array('className'    => 'Event',
>                               'conditions'   =>
> 'Event.datefield>=date("Y-m-d")',
>                               'order'        => '',
>                               'dependent'    =>  true,
>                               'foreignKey'   => 'event_category_id'
>                         )
>                   );
>
> But it is not working .pls see the difference of conditions element of
> hasmany.
>
> Pls let me how can i show the events  category wise and only those
> events whose yet to come.
>
>
> My second question is :-
>
> I want to show the events for the current week day wise.
>
> How can solve my above 2 queries.
>
> Pls let me know.
>
> Thanks
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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