简体   繁体   中英

Attribute selected option into a variable to show input field using SQL

I need to attribute the selected value from my dropdown list into a variable that I can use in my sql query.

I know that I have to use Ajax or jQuery but I can't because I don't learn it yet

Picture 1 : Picture 2 :

 <!-- Début PHP Catégories --> <?php $resCat=mysqli_query($conne,$reqCat); ?> <div class="form-group"> <label class="col-md-3 control-label">Catégorie</label> <div class="col-md-9"> <select class="form-control select" name="categorie" id="categorie" "> <?php while ($rowCat= mysqli_fetch_row($resCat)) { ?> <option value="<?php echo $rowCat[1] ?>"><?php echo $rowCat[0] ?></option> <?php } $categorie = $_POST['categorie']; ?> </select> </div> </div> <!-- Fin PHP Catégories --> 

Thanks

对于您的情况,您可以简单地使用表格,并且在选择了选项之后验证按钮时,您只需恢复选项的值并提出请求即可

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM