Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7695161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:29:08+00:00 2026-05-31T21:29:08+00:00

How on earth do I make this work? I have a database with 3

  • 0

How on earth do I make this work?

I have a database with 3 tables.

Table 1: Categories
Table 2: Organisations
Table 3: Link table with 2 colums: Category id, Organisation id.

I want to make this interface:

http://www.glowong.nl/Uploads/26-03-2012-13-46-52.jpg

When I click on ‘Opslaan/save’. The new connections should be written to Table 3.

I don’t know where to start.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:29:09+00:00Added an answer on May 31, 2026 at 9:29 pm

    At first glance, I would do something like so:

    1) When you render the page HTML, make each Organization a named array of checkboxes where the values are the categories, like so:

    <INPUT type="checkbox" name="naam1[]" value="Hosting"> 
    <INPUT type="checkbox" name="naam1[]" value="Crediteur">
    <INPUT type="checkbox" name="naam1[]" value="Debiteur">
    ....
    <INPUT type="checkbox" name="naam2[]" value="Hosting"> 
    <INPUT type="checkbox" name="naam2[]" value="Crediteur">
    <INPUT type="checkbox" name="naam2[]" value="Debiteur">
    

    etc

    2) When the form is submitted, loop through your org/categories like so:

    foreach ($orgs as $org) {
        foreach ($categories as $category) {
             if (in_array($category,$_POST[$org])) {
                 //the category for the given org was checked; 
                 //make sure this relationship exists in the DB
             } else {
                //category for this org not checked;
                //if the relationship exists in the DB, delete it
             }
        }
    }
    

    I think something like that would work. You could have problems with this solution if you have a whloe bunch of orgs and categories since we’re doing a Cartesian-ish join in the loops, but if you have that many orgs and categories you may need to rethink your interface anyhow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to show a map using the Virtual Earth API: <script
This is driving me nuts. I have two tables that I am attempting to
Why on Earth doesn't the interpreter raise SyntaxError everytime I do this: my_abc =
The URL http://www.fourmilab.ch/cgi-bin/Earth shows a live map of the Earth. If I issue this
EDIT: The problem is that I used .select() instead of .find(); I have this
I'm trying to make a navigation/control panel for a Google Earth browser API. So
I want to show a random record from the database. I would like to
I want to parse the contents of a dynamic .csv file. However, this code
What I mean by this is, since your browser doesn't cache the Google Earth
I have the following enum: public enum Materials { Wood, Stone, Earth, Water, Lava,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.