How can i search multiple criteria in dropdown list?

gaz

New Member
I have a tutor database (MySQL) which store tutor available subjects,example:-tutor1 available subject = A,B,Ctutor2 available subject = A,Btutor3 available subject = Ain SearchTutor.php;\[code\]<select id="select3" class="medium" name="upsr"><option selected="selected" value="http://stackoverflow.com/questions/3656078/%">-</option><option value="http://stackoverflow.com/questions/3656078/A">A only</option><option value="http://stackoverflow.com/questions/3656078/A,B">A and B only</option><option value="http://stackoverflow.com/questions/3656078/A,B,C">All Subjects</option></select>\[/code\]in DisplayTutor.php;\[code\]$subjectin = '';$subdescription = ''; if(strlen($upsr) > 1) { $subjectin .= "'106',"; if($upsr == "A") $subdescription .= "'A',"; else if($upsr == "A,B") $subdescription .= "'A','B',"; else if($upsr == "A,B,C") $subdescription .= "'A','B','C',"; else $subdescription .= "'".$upsr."',"; }\[/code\]so.. what i want is, when i choose "A only",the result should be tutor3, because i want "A only", those tutor with A,B,C is not qualify, same goes to when i choose "All Subjects", the result should be tutor1, because only tutor1 have all subjects,but in my coding, i know it was wrong, is there anyone can help me solve this ?Thank you all programmer, ^^
 
Back
Top