Hi,
I have this query:
$results = $this->find('list', array(
'conditions' => array('1 = 1'),
'fields' => 'REG_ID, REG_NAME',
'order' => array('REG_NAME ASC')
));
and I do a
echo $this->Form->input('city', 'options' => $getCities, 'id' =>
'city'));
to g
> What error displays?
syntax error, anyway i found the solution:
http://blog.pepa.info/php-html-css/cakephp/populating-a-select-box-with-distinct-values/
find( list,..) doesn't support distinct, so i should make a lot of
find all and set combine..
thank you ;-)
--
pietro
--~--~-~--~-
What error displays?
On May 25, 2:21 pm, fain182 wrote:
> > Take a look athttp://book.cakephp.org/view/809/find-count
>
> i tried:
> $this->set('stati',
> $this->{$this->Singular}->Sito->Stato->find(
> 'list',
> array('fields'=>'DISTINCT stato')
> )
> );
> Take a look at http://book.cakephp.org/view/809/find-count
i tried:
$this->set('stati',
$this->{$this->Singular}->Sito->Stato->find(
'list',
array('fields'=>'DISTINCT stato')
)
);
but results in a SQL error... the query generated is:
SELECT `Stato`.`id`,
Take a look at http://book.cakephp.org/view/809/find-count
On May 24, 3:30 am, fain182 wrote:
> hello,
> i have a table 'posts' like:
> id, author, subtitle, text, other fields..
>
> i want to make a search with some select(one for author, one for
> subtitle, ecc.), what is the best way? it's po
hello,
i have a table 'posts' like:
id, author, subtitle, text, other fields..
i want to make a search with some select(one for author, one for
subtitle, ecc.), what is the best way? it's possible to use distinct
in combination with find('list',..) ?
thank you
--
pietro
--~--~-~--~