mercredi 17 juin 2015

Search With Multiple Checkboxes to Choose MySQL Fields

I've a fields in database are report_id,report_name,abstract,student_name,teacher,name

Then I've create Multiple Checkboxes to Choose the fields that you want to Search and Input the Keyword like this

<form action="searching.php" method="post" >
<label class="checkbox">
  <input type="checkbox" name="report_id" value="report_id">Report ID
</label>
<label class="checkbox">
  <input type="checkbox" name="report_name" value="report_name">Report Name
</label>
<label class="checkbox">
  <input type="checkbox" name="abstract" value="abstract">Abstract 
</label>
 <label class="checkbox">
  <input type="checkbox" name="student_name" value="student_name">Student Name
</label>  

    <input type="checkbox" name="teacher_name" value="teacher_name">Teacher Name
    </label>
  <input name="txtKeyword" type="text" class="form-control" placeholder="Input Keyword" id="txtKeyword">
  <button type="submit" class="btn btn-primary">Submit</button> 
</form>

Finally , How to write the query to OR the conditions ,Thank you guys for the answer




Aucun commentaire:

Enregistrer un commentaire