MyBB Community Forums

Full Version: PHP - Multiple form options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically I need a form where you can select multiple values and then those values will be used to select from the database.

<input name="name[]" type="checkbox" value="X" checked="checked" />
<input name="name[]" type="checkbox" value="Y" checked="checked" />
<input name="name[]" type="checkbox" value="Z" checked="checked" />

And what I want the resulting query to be, if you chose, say, X and Y:

SELECT * FROM `table` WHERE `field` IN ('X','Y');

That sort of thing... looked on Google and found sod all (apart from finding out to use []), so wondering if anyone here can help me Angel
Wait... like Select all that apply to you form?
Yes, so if you choose X and Y, it selects records where the where a column = X or Y, if you choose Z and X, it selects records where the where a column = Z or X, etc...
I spent over 15 minutes searching, and this is similar to what you need, but needs modification:

I hope it helps, at least a bit.
-Dropdown Select With PHP and MySQL