根据从下拉菜单中选择的选项显示数据

时间:2018-07-16 11:02:24

标签: php drop-down-menu

我是编程的始作俑者,我拥有php代码,并且我希望根据选项mysql菜单显示selected from the dropdown数据库中的某些数据,这是选择菜单:

  <p><select name="category"class="form-control1"  required="required">
          <option value="">--report category--</option>
          <option value="rbNumber"  >RB report & range of date</option>
          <option value="policeStationID" >Police station report & range of date</option>
          <option value="zone"  >zone report & range of date</option>
          <option value="region" >region report & range of date</option>

     </select> 
    &nbsp&nbsp
 <input type="date" name="date1" required="required">&nbsp&nbsp
 <input type="date" name="date2" required="required">&nbsp&nbsp
 <input type="submit" name="submit" value="search Report"></p></form></h2>

我想要,当我选择rb报告选项时,要执行的查询并选择相应的数据并显示它。

1 个答案:

答案 0 :(得分:0)

您要寻找的内容无法用纯PHP完成。您需要使用AJAX,这是回答类似情况的示例线程: Fire AJAX when value selected from dropdown