Hello everyone,
I am using CakePHP to build an application that will run on en
existing database. The problem I am facing is simple, I have products
table and let's say it is like this: id, name, supplier
Some stupid programmer (yes I am angry to him) didn't created the
table with supplier_id. So every time a product is being added
supplier field must be entered manually. This is not my problem. What
I want to do is to retrieve all the unique supplier names.
I tried:
$this->Product->find(
'all',
array(
'fields' => array('Product.supplier'),
'group' => 'Product.supplier'
)
);
It does not work. When I query the database manually using "SELECT
supplier FROM table GROUP BY supplier" it works.
Thank you very much for your answers.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---