I have a problem with sending and receiving data when I'm trying to use "select all options" as a value in sql query. Is this method is correct or am I doing something wrong? I was trying also "*", "ALL", "%" AND "?"....
php:
SQL = select table1 where name='$selected_options1' and instructor_name='$selected_options2'
$selected_options1=$_POST['selected_name'];
$selected_options2=$_POST['selected_instructor_name'];
html:
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Mat'>Mat
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Ann'>Ann
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Peter'>Peter
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Tom'>Tom
<INPUT TYPE=checkbox NAME='selected_name' VALUE='*'>All names
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Ron'>Ron
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Tim'>Tim
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Greg'>Greg
<INPUT TYPE=checkbox NAME='selected_name' VALUE='Bob'>Bob
<INPUT TYPE=checkbox NAME='selected_name' VALUE='*'>All instructors
Right now my query looks like:
("SELECT * FROM `table1` WHERE instruktor in ('$instruktor1', '$instruktor2', '$instruktor3', '$instruktor4', '$instruktor5', '$instruktor6', '$instruktor7', '$instruktor8', '$instruktor9', '$instruktor10', '$instruktor11', '$instruktor12') AND (instruktor_poczatkowy='$instruktor_poczatkowy1' OR instruktor_poczatkowy='$instruktor_poczatkowy2
OR instruktor_poczatkowy='$instruktor_poczatkowy3 OR instruktor_poczatkowy='$instruktor_poczatkowy4 OR instruktor_poczatkowy='$instruktor_poczatkowy5
OR instruktor_poczatkowy='$instruktor_poczatkowy6 OR instruktor_poczatkowy='$instruktor_poczatkowy7 OR instruktor_poczatkowy='$instruktor_poczatkowy8
OR instruktor_poczatkowy='$instruktor_poczatkowy9 OR instruktor_poczatkowy='$instruktor_poczatkowy10 OR instruktor_poczatkowy='$instruktor_poczatkowy11)
AND (klub='$klub1' OR klub='$klub2') order by nazwisko");
which still doesn't solve my problem. You can read about it in my comments.