SQLクエリの値として「すべてのオプションを選択」を使用しようとすると、データの送受信に問題があります。この方法は正しいですか、それとも私は何か間違ったことをしていますか?「*」、「ALL」、「%」、「?」も試してみました。
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
現在、私のクエリは次のようになっています。
("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");
それでも私の問題は解決しません。あなたは私のコメントでそれについて読むことができます。