Jump to content

Need Help Please Dynamic Checkbox


benaust

Recommended Posts

Any help Appreciated in advance,

PHP - MYSQL

I have two tables

 

Table "A" ( This table has a list of Checkboxes I like to appear in the form, so I can add more checkboxes in the future and they get listed in this particular for from database, e.g Below )

 

 

-------------------------------------

| Chk Title  |  Chk TA Ref Number |

-------------------------------------

| Chk Name 1  |  1122              |

| Chk Name 2  |  1324              |

| Chk Name 3  |  3421              |

| Chk Name 4  |  3234              |

-------------------------------------

 

 

Table "B" ( This is the table that keeps the name of the person who selects the checkbox and the reference number of that particular Checkbox, so if this person selects three Checkboxes, there will be three records in this table e.g Below)

 

-------------------------------------------

| User Name        |  Chk TA Ref Number  |

-------------------------------------------

| User 1 Name      |  1122              |

| User 1 Name      |  1324              |

| User 1 Name      |  3421              |

| User 2 Name      |  1122              |

| User 2 Name      |  3421              |

| User 3 Name      |  3421              |

| User 3 Name      |  1122              |

| User 3 Name      |  3421              |

-------------------------------------------

 

When user wants to update the form the check boxes gets retrieved from database Table "A" and like to see which ones where ticked from table "B"

 

 

I cannot get my head around this, I have tried few thing which none worked, Could you please help?

 

Thanks

 

Ben

Link to comment
Share on other sites

Do a left join in sql, then both tables will be linked even though there is no records in table B, then check the Chk TA Ref Number in table B if a value exists, if it does then you can select the check box.

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.