Forums

This topic is locked

DW 2004 MX php, unused primary key

Posted 21 years ago
1
has voted
21 years ago Anton Sutterlueti posted:
i have a huge problem with the update behavior of DW 2004 in php i get always an unused primary key and it tells me i have to set a value for my primary key, this key is in the database and has auto incriment, so i dont need to set anything. please let me know what i can do with it or email me or AIM ToXiT44 i am really frustrated and it is driving me nuts...

Replies

Replied 21 years ago
21 years ago Theologos Fragopoulos replied:
Hi.

When you use the update record behavior you usually create first a recordset and bind the columns of the database inside your form elements. Even if you do not want to do that you must create a recordset, so you can create a hidden field in the form, set its name to id with a value of the id bind from your recordset. After that aply the update record and you will see that the first line on the update behavior will say Select ID etc....
and will let you continue...

Don't forget you must first select a record. So you can select it you must point to a primary key so it can be for sure unique. That is why u use only the ID in the hidden field.

I am not good in words so I am writing a summary beneeth and if you need anything post again.

1. Create a Recordset in your update page and bind all elements if you wish (it is the best)
2. Inside your form create a hidden field, name it id, and bind the id of the recordset you just created to the hiddens field value.

3. Apply the update Behavior

I hope I was helpfull

Reply to this topic