Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Primary key cannot be changed
  • Hi guys, I have the following tables set up: locations
    id
    name items
    id
    name location_items
    id
    location_id
    item_id These have models as such: Item Model - http://scrp.at/bbC
    Location Model -http://scrp.at/bbB
    LocationItem Model - http://scrp.at/bbA When trying to delete a LocationItem record:
    $item = Model_LocationItem::find(11);
    $item->delete();
    

    I get an error saying the Primary key cannot be changed and don't understand why. I'm not trying to change any primary keys, just delete the Relationship. Any help would be much appreciated.
  • http://scrp.at/bbA is a belongs to relation, not a has one.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion