我試圖創建一個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>
有人可以解釋我怎麼能顯示有說出來的搜索
可能需要一些細節。你是在問一旦搜索發生了怎麼辦? – sbatson5 2013-04-09 20:04:00