List Info

Thread: How to use different arrayconditions on the same field.




How to use different arrayconditions on the same field.
country flaguser name
United States
2007-10-18 06:10:10
Hi,
Are there a way to use the same field multiple times in
arrayconditions?
The problem is that you have to use the same arraykey again
which of
course is impossible.

An example is when I want to get all articles between two
given dates
like this.

$this->Article->findAll(array(
	'Article.publishdate' => '> 2007-01-01 15:00',
	'Article.publishdate' => '< 2007-08-08 15:00'
));

The second condition will overwrite the first. A dirty hack
to make it
work, is insert af space after one of the arraykeys. Like
this:
$this->Article->findAll(array(
	'Article.publishdate' => '> 2007-01-01 15:00',
	'Article.publishdate ' => '< 2007-08-08 15:00'
));

But that is really ugly and there is no way(that I know of)
to make
the formhelper do it.

Thanks in advance,
Niels


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Cake PHP" group.
To post to this group, send email to cake-phpgooglegroups.com
To unsubscribe from this group, send email to
cake-php-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )