I am making a website that will show night club revelers events and night establishments in a big city.
A user should be able to add certain details when adding their event on the site e.g.(in the events table) event_id, event_name, event_description, event_date, event_photo_url etc.
I want users to be able to search or find certain events or establishments based on interests. I have an interest table that looks like this.
interest_id, interest-name
1, Shoot Pool
2, Karaoke
3, Lounge
4, Live Band
5, Dancing
6, Watch Sports
So there are 6 checkboxes on my form. A user can select none, 1, 2 or all 6.
Should I have each checkbox submit individual values to my submit form, ie
input name="dancing" type="checkbox" value="5"
input name="watch_sports" type="checkbox" value="6"
Or should I build an array
input name="interest[]" type="checkbox" value="5"
input name="interest[]" type="checkbox" value="6"
I have a table to link events with interests ie;
event_interest table
event_interest_id
event_id
interest_id
I have never implemented a series of check boxes before. Does anyone know the way to go about capturing user input and storing the values in my database?
<input type="checkbox" name="boxArray[name]">If you knew already, my apologies for insulting your intelligence.