Multiple primary key

Multiple primary key

culcul89culcul89 Posts: 4Questions: 1Answers: 0
edited February 2015 in Free community support

Hi guys, i'm working with DataTable and i find it very usefull, now i have to show and update a table which have 3 primary key and i don't know how to code it.
I'm using Editor::inst( $db, 'table', 'pKey' ) but when i do an update, there's an error because i have more than one of those pkey.
Anyone had this problem before?
Thak you!

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    What database allows a table to have multiple primary keys?

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Most databases allow multiple columns to be used as a primary key (known as a compound key), which is what I presume @culcul89 is referring to.

    @culcul89 - At this time the prebuilt Editor PHP libraries do not support compound keys. It is a feature that I plan to add in future, but at the moment you would need to create your own server-side scripts to have it work with Editor.

    Regards,
    Allan

  • culcul89culcul89 Posts: 4Questions: 1Answers: 0

    @allan yeah that is what i mean...well i'm not that expert in PHP so i don't know how to do it..any idea when this update can come?
    Thanks

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Likely not until the second half of this year to be honest as I've got a number of other features I want to deploy first.

    Allan

  • culcul89culcul89 Posts: 4Questions: 1Answers: 0

    uhm, i would like to buy it but i can't without this feature..any suggestion for helping me to do it?

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Sorry - it sounds like Editor isn't suitable for your use case at the moment :-(

    Allan

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    It didn't occur to me that you meant a compound key. I used compound keys for a short time but they became so awkward to work with that I scrapped them.

This discussion has been closed.