This topic is locked

edit record

5/24/2007 4:24:21 PM
PHPRunner General questions
L
leckey author

But when I edit the subset records it changes the value for all the records in the subset. I have the relationship between the two tables on and id field in both tables. I'm sure this is why it's updating all records. How can I set it so it changes only the record set I'm Editing?

Thanks,

Sergey Kornilov admin 5/24/2007

Make sure you selected correct key column that has unique value for each record.

L
leckey author 5/25/2007

Hello:

I do have a selected correct key column but it doesn't have a unique value for each record. This is because the table can contain multiable records, releated to the master table. [User Table] contains userid(can only have one id per user) and fnam and lnam then the Second table [KeysIssued] contains userid(can have more then one) 1st record - "key to front door" and 2nd record "key to back door". I can't link to master, do I need to create a table that links both tables that only contains key field from each table? I just want to be able to edit the sub table [KeysIssued] and only effect the one record. I am trying to follow the data normalization concept.

Thanks,

But when I edit the subset records it changes the value for all the records in the subset. I have the relationship between the two tables on and id field in both tables. I'm sure this is why it's updating all records. How can I set it so it changes only the record set I'm Editing?

Thanks,

L
larsonsc 5/25/2007

What I usually do when I have tables that will contain many detail records that should logically link to a master record, is create a field in the table that will have multiple records usually named something like recordID and assign it as an Integer field, auto-increment, and make it the primary key for that table. You don't actually have to show the field on any of the pages you generate (just remove the checkmark for the field on the select fields page), but it does allow the database to know specifically which record you want to edit and should prevent multiple records from being updated when you are only trying to just edit a single record.

Sergey Kornilov admin 5/25/2007

If column values not unique across the table that means you cannot choose this column is a key field. It simply won't work and this is what you experiencing.
Add a new field to details table (integer, autoincrement) and use it as a key column.

L
leckey author 6/6/2007

If column values not unique across the table that means you cannot choose this column is a key field. It simply won't work and this is what you experiencing.

Add a new field to details table (integer, autoincrement) and use it as a key column.


Yes I tried and this solves the problem.