Hey
I've had a bit of a nosey around and can't seem to find the answer to
my problem.
I have two tables ( cars, products) and a join table ( cars_products)
all set up with a HABTM relationship using bake.php.
I want to be able to return a set of results from products that are
related to a particular car and also filtered by another field in
products.
$the code that i'm using is:
$conditions = array ( 'Car.id' => $carId,
'Product.category_id' => $categoryId );
$this->set ( 'productList', $this->Product->findAll ( $conditions ) );
which just outputs "SQL Error in model Product: 1109: Unknown table
'Car' in where clause"
I have tried it the other way around and i just get warned that
Product is an unknown table. I'm sure I am missing something as this
is a fairly simple query to do with pure SQL
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---