我有这个搜索功能与类别,当你点击这个类别,你将在该类别内搜索,但我想使它,使我能够在多个类别内搜索关键字。这是我的表格:
<form method="get" action="zoek.php">
<input type="text" name="producttitle" placeholder="Productnaam">
<input type="hidden" name="prodgroup" value="<?= (isset($_GET['prodgroup'])) ? $_GET['prodgroup'] : '' ?>">
<input type=submit class="btn btn-primary" value="Zoek...">
</form>
这是您单击类别并搜索单词的代码
<?php
if (isset($_GET['prodgroup']) && $_GET['prodgroup'] != "" && isset($_GET['producttitle']) && $_GET['producttitle'] != "") {
$category = $_GET['prodgroup'];
$prodtit = $_GET['producttitle'];
$query = $readconn->prepare("
SELECT S.StockItemID, S.StockItemName, S.Photo, S.UnitPrice, S.Photo, S.Brand
FROM stockitems S JOIN stockitemstockgroups SISG ON S.StockItemID = SISG.StockItemID
JOIN stockgroups SG ON SISG.StockGroupID = SG.StockGroupID
WHERE SG.StockGroupID = '" . $category . "'
AND S.StockItemName LIKE '%" . $prodtit . "%'
");
以下是带有id的类别: `.
49条答案
按热度按时间sdnqo3pr31#
----: | 7 | 8 | :
eh57zj3b32#
----+
abithluo33#
---+
xtfmy6hx34#
----: | 5 | 4 | :
62lalag435#
----+
tktrz96b36#
-: | 8 | Furry Footwear | :
llmtgqce37#
-: | 9 | Toys | :
v1uwarro38#
----'
5w9g7ksd39#
----: | 1 | 2 | :
js81xvg640#
-: | 4 | T-Shirts | :
yjghlzjz41#
----+
t3psigkw42#
----+
46qrfjad43#
----+
ih99xse144#
---+
fjaof16o45#
---+