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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.