loganbest Posted May 8, 2011 Share Posted May 8, 2011 Hi, I’m fairly new to OOPHP and CI so I had a quick question that could be an easy answer for some people. I have a form right now with about 100 checkboxes all with the same name so they will submit as an array of numbers. I also have a table named tag_restaurant_rel which is a relational table that is setup as InnoDB and both `restaurant_id` and `tag_id` are Foreign Keys relating to the corresponding columns in two other tables. The form will be submitted with 1 restaurant_id and several tag_id’s. In the tag_restaurant_rel table there is a record for each tag_id in the array all with the same restaurant_id from the form. What I need to happen is for the form to be submitted and depending on the array of checkbox values the tag_restaurant_rel table will need to delete the records that are not in the array and create a new record for each tag_id in the array. I’m mostly curious in the most efficient way to do this OOP and CI style. Quote Link to comment https://forums.phpfreaks.com/topic/235872-db-query-with-checkbox-group/ 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.