Php搜索按钮数据库无法正常工作 [英] Php search button database is not working
本文介绍了Php搜索按钮数据库无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
İts不工作我不知道为什么
我的html表格
İts not working i dont know why
My html form
<div class="title_box">Search</div>
<form method="get" action="results.php" enctype="multipart/from-data">
<input type="text" name="user_query" class="newsletter_input" placeholder = "Ürün arayın" / >
<input type="submit" name="search" class="button" value="HIZLI ARA" / >
</form>
我的PHP代码
//结果.php
包括数据库......
....
My php code
//results.php
include database....
....
<?php
if (isset($_GET['search'])) {
$search_query = $_GET['user_query'];
$get_pro = "SELECT * FROM product WHERE title LIKE '%search_query%' ";
$run_pro = mysqli_query($con, $get_pro) or die(mysql_error());
while ($row_pro=mysqli_fetch_array($run_pro)) {
$pro_id = $row_pro['id'];
$pro_title = $row_pro['title'];
$pro_descrip = $row_pro['descrip'];
$pro_price = $row_pro['price'];
$pro_way = $row_pro['way'];
$pro_keywords = $row_pro['product_keywords'];
echo
'<div class="prod_box">
<div class="center_prod_box">
<div class="product_title"><a href="details.html">'.$pro_title.'</a></div>
<div class="product_img"><a href="#"><img src=prod/'.$pro_way.' alt="" border="0" height="71" width="94"/></a></div>
<div class="prod_price"><span class="reduce">750$</span> <span class="price">'.$pro_price.'$</span></div>
</div>
<div class="prod_details_tab"> <a href="#" class="prod_buy">Sepete Ekle</a> <a href=details.php?pro_id='.$pro_id.' class="prod_details">İncele</a> </div>
</div>';
}
}
?>
....
....
推荐答案
_GET [' search' ])){
_GET['search'])) {
search_query =
search_query =
_GET [' user_query'];
_GET['user_query'];
这篇关于Php搜索按钮数据库无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文