for example :
I have 4 check box with their own variables a,b,c,d
How can I create query with condition using what users choose,
where users can choose more than one check box

thanks for your support

Recommended Answers

All 4 Replies

What type of query (SELECT, UPDATE, INSERT...). Also, can you provide the html for the checkboxes?

maybe something like:
"select.....blah blah....where a = $_POST and b = $_POST"
and the html is:
<input type='checkbox' name='checkboxarrayname[a]' value='1'>

basically using posting array variables
HTH

the problem is we don't know which checkbox is checked and count how many checkbox is checked, example we know 2 checkbox is checked so the query is two condition. if three checkbox is checked so the query is three condition.
can I make a query with a dinamic condition according how many checkbox is checked?

When you submit the page, only those checkboxes which were checked will be submitted. So, you will have the count of checkboxes which are checked, you will have all the checkboxes which were checked. Build your query depending upon those values.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.