So here is my problem:
I need to get information from my database (MySQL) through filters applied with checkbox.
As a constraint I must do it in javascript then use Ajax to execute the request.
It would have been with radio input that would have been fine, but as it is checkbox I cannot determine in advance how many filter my user will have when getting the information they want.
I was thinking of creating a string that would be a concatenation of the filters I need but I'm not sure if it is good practice nor if it would be security breach :( (which is definitely BAD for that project)
here is an exemple of what I'd like to do:
[ ] a [x] b [ ] c
then my SQL request should be:
SELECT 'column' FROM 'table' WHERE 'id' = b
and in this case
[x] a [ ] b [x] c
then my SQL request should be:
SELECT 'column' FROM 'table' WHERE 'id' = a OR 'id' = c
I hope this does help you understand what I'm looking for.
And do not hesitate if you need more information!!
Thank you in advance =)