I will try to be as specific as I possibly can.
I have a table with the following fields.
show
channel
series
interactive
reward
romance
twist
fame
celebrity
I would like to create checkboxes for users to click on for a keyword search (for example..they want a show that is romance & twist they would check those boxes)
Within my table I already have the values of the show...if the show is a romance it will have a 1 in the romance field. If it's not a romance show then it will have a 0.
I would like the checkboxes created/formatted from an array (that way I can add more columns as needed) from the table. I would like to exclude the fields "show" "channel" "series".
After the user clicks submit I would like to for a query from the checkboxes clicked.
example
$query = "select * from reality where series = 1";
then I would like to loop through the fields that were checked and for the first field name the query string would be adding
$query .= " AND $checkboxName = 1"
then for each and every subsequent checkbox the query string would add
$query .= " OR $checkboxName = 1"
2 things I need to know:
1) How to set up the checkboxes
2) suggestions for the loop on the query
Thank you!