Thanks Pablo,
Your first one has worked. However second one didn't work.
for second one ( for extarcting current week's event DAY WISE) i am
using $this->event->findall as the date field is in the event table.
I have tried to put 2nd condition in as
$conditions="Event.eventday>=now() AND
Event.eventday<DATE_ADD(now(),INTERVAL 1 Week)";
$this->Event->findAll($conditions);
It is returning an empty Array.
Please help.
Thanks again
On Aug 10, 12:39 am, "Pablo Viojo" <[EMAIL PROTECTED]> wrote:
> Try
>
> 1 - 'Event.datefield>=now()'
>
> 2 - 'Event.datefield>=now() AND Event.datefield<DATE_ADD(now(),
> INTERVAL 1 WEEK)'
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]://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- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---