CakePHP does not support composite primary keys. This has been
discussed at length. Just add an auto-incrementing column to your
table and make that the primary key [ change your primary key index to
a unique index first ].

> How do I delete a row? I cannot seem to do $this->FoodCategory->del($id)

Assuming food_id/category_id are unique, this will work fine:

$this->FoodCategory->deleteAll(array('food_id' => 1, 'category_id' =>
3), true, true);

(If they're not unique this may delete more than one row)

> Cake requires a single primary key "id".

Well, you don't have to call it "id". Just set the `$primaryKey`
member variable (in the model) to the name of the primary key.

hth
grigri
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to