I have some checkbox like this
<form action="tt.php" method="post">
<input type="checkbox" name="lvl[]" value="0">0 
<input type="checkbox" name="lvl[]" value="1">1 
<input type="checkbox" name="lvl[]" value="2">2 
<input type="checkbox" name="lvl[]" value="3">3 
<input type="checkbox" name="lvl[]" value="4">4 
<input type="submit" value="Ok">
How to add values from checked ones to SQL query like this?:
If checked 2 and 4 thenselect name,lvl,team from $table where lvl=2 or lvl=4
If checked 2 and 4 AND 0 then select name,lvl,team from $table where lvl=2 or lvl=4 or team='abc' (if 0 checked then ‘select’ must contains strings where team=’abc’, if not – don’t)
If none is selected thenselect name,lvl,team from $table
Edit
What happens if you replace this:
With:
Change your code to this: