PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a form with checkboxes that I want users to be able to log back in and edit whenever needed and I want their previous selections to remain checked. The problem I'm having is that my code will only return the 2nd and 3rd entry in my array. So if a person previously had 5 options checked, my form is only showing 2 of the options checked. I can't seem to figure out what I'm doing wrong. I have about 60 options in my form but have shortened it to just 2. See below...
An optimization with regards to your database design may be in order. Unless "activities" is a SET, I would probably suggest adding two more tables: one for the various activities, and one to link the user and activity they are involved with.
I previously had my database set up with a separate field for each activity. But it was just so many fields I was trying to find a way to shorten it. I will play with it a bit more and if I still have no success, I will stick with my current method. In the meantime, any other suggestions are welcome! Thanks!
Unless I misread Everah's post, we're not even remotely referring to separate fields for the activities. Records is what we're talking about. Note how I specifically said "adding two more tables."