One table with two primary key
One table with two primary key
meichichan
Posts: 5Questions: 1Answers: 1
in Editor
How to pass the id in "one table with two primary key" case?
Editor::inst( $db, 'RacingGroupRoute' , array('RacingID','GroupID') )
show error : Primary key data doesn't match submitted data
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The use of compound primary keys is documented here:
https://editor.datatables.net/examples/advanced/compoundKey
it's show error : Primary key data doesn't match submitted data
Ajax Load
Javascript
Server script
That looks wrong. It should be a combination of RacingID and GroupID.
What version of Editor are you using?
Allan
Thanks for reply.
How to combine RacingID and GroupID ?
Like this? It's still error ><
Editor-PHP-1.6.5
You don't need to combine them at all - it should be doing it automatically for you.
In this example the two columns are combined thus:
The middle part is a hash that the libraries will automatically calculate.
Can you show me the JSON that is being loaded from the PHP script when the page is first loaded?
Thanks,
Allan
After I remove "DT_RowID" which I set, it's show Uncaught Unable to find row identifier For more information, please refer to https://datatables.net/tn/14...
JSON Data (remove "DT_RowID"):
http://helper.irunner.com.tw/datas/timing/group/1057
I know my problem now.
Just use Editor to generate json data, not define by myself.
Thank for your help.
Yup - I didn't realise that you were modifying the data from the Editor instance. If you just let it do its thing it should work.
Allan
thank
i need this compound key
if possible check my code
when edit row every thing is okey
but when i want add row show this error
Primary key data doesn't match submitted data
i attach table i attach table picture if it help
thanks
javascript code
server script
I think you'll need to use:
for the primary key identifiers in the constructor.
Thanks,
Allan
thanks for answer
but not anything change
error : Primary key data doesn't match submitted data
when i want insert a row
can i send my cpanel user and password for you
for check my code?