您好,您能帮我解决一个我遇到问题的脚本吗?\ 我想从不同的列和价格范围创建一个搜索脚本:所以 search.php 是:
<?php
/* connect to the database*/
$db = new mysqli("localhost", "root", "", "movie");
/* check connection */
if ($db->connect_errno) {
echo "Connection failed: " . $db->connect_error;
exit();
}
$query="SELECT * FROM `filmi`
WHERE (`nomer` rlike '%$search%' OR
`rezume` rlike '%$search%' OR
`kategoriq` rlike '%$search%') AND
`seriq` BETWEEN '%$pricemin%' AND '$pricemax'
ORDER BY seriq ASC";
/* create a prepared statement */
if ($stmt = $db->prepare($query)) {
/* bind parameters for markers */
$stmt->bind_param("sssdd", $search, $search, $search, $pricemin, $pricemax);
/* execute query */
$stmt->execute();
/* get result */
$result = $stmt->get_result();
if ($result) {
/* now you can fetch the results into an assoc array */
while ($row = $result->fetch_assoc()) {
echo $row['nomer']. ", " .$row['rezume']. ", " .$row['kategoriq']. ", " .$row['seriq']. "<br>";
}
}
/* close statement */
$stmt->close();
}
/* close db connection */
$db->close();
?>
填写 $search 和 $pricemin / $pricemax 字段的“ <form method=?>
”表单应该是什么?