glad to help.
On Dec 21, 2007 12:43 AM, Fabian <[EMAIL PROTECTED]> wrote:
>
> thanks baz that worked great =)
>
> On Dec 19, 7:52 pm, Fabian <[EMAIL PROTECTED]> wrote:
> > $conditions = array("`date_added` > " . "'" . $startDate . "'",
> > "`date_added` < " . "'" . $endDate . "'");
> >
> > On Dec 17, 3:30 pm, Baz <[EMAIL PROTECTED]> wrote:
> >
> > > Make sure debug is on and check the Query that is being written.
> >
> > > I, personally, have never used the "BETWEEN" for MySQL. I usually have
> > > something like:
> >
> > > $from = ....
> > > $to = ....
> >
> > > $condition = array('date' => "date > $from and date < $to");
> >
> > > But that's just me.
> >
> > > On Dec 17, 2007 3:18 PM, Fabian <[EMAIL PROTECTED]> wrote:
> >
> > > > Hi is it posible to define the $conditions inside a function instead
> > > > on the beginning of the controller. I have the following
> >
> > > > <?php
> > > > class EventsController extends AppController {
> > > > var $conditions = array();
> >
> > > > function encrypt() {
> > > > $conditions = array("date_added" => "BETWEEN 2007-11-01 AND
> > > > 2007-11-02");
> > > > $this->set('events',
> > > > $this->Event->findAll($this->conditions));
> >
> > > > if (isset($this->namedArgs['date']))
> > > > {
> > > > echo $myParam1 = $this->namedArgs['date'];
> > > > }
> >
> > > > ?>
> >
> > > > I want to use the $this->namedArgs['date'] in the conditions
> variable,
> > > > but right now I just wrote the static code since I'm trying to make
> it
> > > > work, but when I run it the condition is ignored and it brings me
> all
> > > > the records regardless of date.
> >
> > > > Is there a simpler way like in a find() where I can get records
> added
> > > > a certain date?
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---