Jump to content

Form with many-to-many Relationships


gorkongroove

Recommended Posts

Hi to All! I am developing a Course Catalog in PHP. In the form for Editing/Inserting Courses I have to work with several tables. The problem to me comes when I have to modify the languages of the course, because the table "courses" is related with the table "languages" by a many-to-many relation ("courses_languages_map" table). This kind of relation occurs several times in the form with other tables (institutions, study areas, ...). I could make another "page" to edit the "courses_languages_map" table, but maybe this way could be confusing for final users, don't you think so? So I am looking for a solution in order to edit the courses' languages in the same page I edit the courses. I've been trying to put a "select" object with all the languages and a "add language button", and another "select" (this one with fixed height) with a "remove language button". When the button "add language" is pressed the highlighted language in the first "select" is inserted in the second "select". This works properlly. My problem is to pass ALL the languages in the second "select" to PHP, so I can update the "courses_languages_map"  table at the same time I update the courses table and all related tables. Any ideas, please? Or maybe someone knows a better way? Thanks in advance and excuse if I have not expressed myself correctly...

 

P.D: I am working with PHP 4.3.10 and Smarty.

 

Link to comment
https://forums.phpfreaks.com/topic/49301-form-with-many-to-many-relationships/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.