我试图创建一个 php 页面,您可以在其中搜索多个给定点的数据库我已经编写了搜索部分,但我不知道如何显示找到的项目到目前为止我的代码是
<html>
<body>
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/grid.css" type="text/css" media="all">
<link rel="stylesheet" href="css/home.css" type="text/css" media="all">
<?php
$connectie = mysql_connect('localhost','root','usbw');
if($connectie == false){echo "error";}
if(mysql_select_db('makelaars',$connectie) == false){ echo "error2";}
?>
<table>
<tr>
<td width= 100>
Soort Object:
</td>
<td>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method='post'>
<select name="soort">
<?php
$query_soort = "SELECT DISTINCT `Soort_object` FROM `objecten`";
$resultaat = mysql_query($query_soort, $connectie);
$inhoud_soort = $_POST['blog'];
while ($soort = mysql_fetch_assoc($resultaat)) {
echo "<option>" . htmlentities($soort['Soort_object']) . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>
<p>Status:</p>
</td>
<td>
<select name="soort">
<?php
$query_status = "SELECT DISTINCT `status` FROM `objecten`";
$resultaatstatus = mysql_query($query_status, $connectie);
$inhoud_status = $_POST['blog'];
while ($status = mysql_fetch_assoc($resultaatstatus)) {
echo "<option>" . htmlentities($status['status']) . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>
<p>Provincie:</p>
</td>
<td>
<select name="provincie">
<?php
$query_provincie = "SELECT DISTINCT `Provincie` FROM `objecten`";
$resultaatprovincie = mysql_query($query_provincie, $connectie);
$inhoud_provincie = $_POST['blog'];
while ($provincie = mysql_fetch_assoc($resultaatprovincie)) {
echo "<option>" . htmlentities($provincie['Provincie']) . "</option>";
}
?>
</select>
</td>
<td>
<input type="submit" value="verstuur" name="soortknop">
</td>
</tr>
<tr>
<td>
</td>
</form>
有人可以解释一下我如何显示与搜索结果相同的数据吗