benaust Posted June 16, 2010 Share Posted June 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
syed Posted June 16, 2010 Share Posted June 16, 2010 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. Quote Link to comment Share on other sites More sharing options...
benaust Posted June 16, 2010 Author Share Posted June 16, 2010 Thanks Syed I tried that, it did not work for me, most probably I did something wrong, but I found my solution in this forum, link below. Thank you guys Dynamic Checkbox and call back [ http://www.phpfreaks.com/forums/index.php/topic,245559.msg1147446.html#msg1147446 ] By Sasa Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.