Re: output DISTINCT records

2006-08-19 Thread c_doug

I did search the group previously and found the topic linked from the
page you posted. I just haven't been able to get it to translate to
what I am doing yet.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: output DISTINCT records

2006-08-19 Thread c_doug

Thanks. I wasn't aware of the search link you posted.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: output DISTINCT records

2006-08-18 Thread bigdog

You should start using search to find help.

www.cakephp.org/search

See this link for help for your problem.

https://trac.cakephp.org/ticket/663


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: output DISTINCT records

2006-08-18 Thread c_doug

Is it possible to do something like this?

$this->set('data', $this->Post->findAll(array('DISTINCT
categories.name', 'Post.category_id'=>$id)));

as in putting DISTINCT in the array?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: output DISTINCT records

2006-08-18 Thread c_doug

You're right. Although, I wonder if there is a way to do it with model
objects rather than SQL.?.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: output DISTINCT records

2006-08-18 Thread Chris Hartjes

I'd say to do in the SQL, otherwise you're looping through records in
the foreach that you don't need.

I don't see why this would be any different for Cake or any other PHP
application.

On 8/18/06, c_doug <[EMAIL PROTECTED]> wrote:
>
> Anyone?
>
>
> >
>


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: output DISTINCT records

2006-08-18 Thread c_doug

Anyone?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



output DISTINCT records

2006-08-18 Thread c_doug

I know how to easily select only distinct records in SQL. However in
CakePHP when using a data model without SQL what is the best way to
only output distinct records? Should that be done near the
'->findAll()' in the controller or near the 'php foreach' in the view?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---