Hello Eevryone, I read a post here http://forums.adobe.com/thread/463635. And i first off want to commend you guys on your awesome contribution to novices like me. I understand the technique presented here but I have a different problem though. I have two tables, which are related by one to many. Personals Table and Courses Table. One person can have many courses. Only the Admin can update and add new courses. The Courses Table has a Foreign key: personal_Id. The admin has a view page and can update personals table easily. How can I add and update courses for a selected Person. I mean how to build the recordset in Dreamweaver CS5 so that I cant pick just that persons ID and add all course just for his account. In the technical sense how do I parse the FK_personal_Id so that the add course form or update course form only stores the course for that personal_ID on Personal Table. Please I hope you understand how I have explained it but I would love to know this procedure. Thank you very much.
>One person can have many courses.
Let's stop here for a second. Can't a course also be assigned to many people? In that case, you really have a many-to-many relationship and need to have at least 3 tables. I don't really see how it would work otherwise unless you are not telling us everything.
In any case, the way you have it designed now you would insert the personal_id of the person you are updating into the course table. Let's see what the other columns you have in all tables.
In this case the courses are particular to each personal, so no two persons can have the course. I understand creating the recordset to extract the persons session when he is logged it, but i would like a situation where I can create a recordset to update the oersons table and then in then update the child table of courses only for the persons ID selected.. Thatnk You. I think is an advanced recordset procedure but I dont know what sql statements to write to achieve it. Much gratitude for anticipated answers
You don't really want to create a recordset to update the tables. You don't mention what scripting language you are using. In ASP, you CAN create updateable recordsets, but it's really not necessary in this circumstance. You simply need to create an update statement to update the parent table, and an insert statement to insert the record into the related table when the form is posted. You can use DW's server behaviors to accomplish one or the other if you want - but not both. If I am performing a CUD on multiple tables, I would think about writing a stored procedure. Again, it depends on your DBMS. I'd suggest looking into DW Insert record and update record server behaviors to start with.