我可以正确填充保管箱,但是当我单击提交时,我找不到在表格中显示所选项目数据的方法。这是代码:
索引.php
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Αναζήτηση Οφειλών Ανά Πολυκατοικία</title>
<link rel="stylesheet" href="tbl_style.css" type ="text/css"/>
</head>
<body>
<form id="form1" name="form1" method="POST" action="search.php">
<?php
include('config.php');
$query = "SELECT DISTINCT odos FROM ofeiles_results ORDER BY odos ASC";
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET NAMES 'utf8'");
$result = mysql_query($query);
echo "<select name='polykatoikia'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['odos'] . "'>" . $row['odos'] . "</option>";
}
echo "</select>";
?>
<input type="submit" name="Submit" value="Select" />
</form>
</html>
</body>
到目前为止一切顺利,保管箱已被填充。然后在文件 search.php 我有以下代码:
搜索.php
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Αποτελεσματα Αναζητησης Πολυκατοικιων</title>
<link rel="stylesheet" href="tbl_style.css" type ="text/css"/>
</head>
</html>
<?php
include('config_barcode.php');
if(isset($_POST['select'])){
$odoss = $_POST['select'];
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET NAMES 'utf8'");
$display_query = "SELECT odos FROM ofeiles_results WHERE odos LIKE '" . $odoss . "'";
$result_exoda = mysql_query($display_query) or die(mysql_error());
print $result_exoda;
$odos = $row['odos'];
$app = $row['perigrafh'];
$enoikos = $row['enoikos'];
$mhnas = $row['mhnas'];
$synolo = $row['synolo'];
echo "</br>";
echo "</br>";
echo "</br>";
echo "<table cellpadding='3' cellspacing='0'>";
echo "<tr>";
echo "<th align='center' bgcolor='#FFCC00'><strong>Οδος</strong></th>";
echo "<th align='center' bgcolor='#FFCC00'><strong>Διαμερισμα</strong></th>";
echo "<th align='center' bgcolor='#FFCC00'><strong>Όνομα</strong></th>";
echo "<th align='center' bgcolor='#FFCC00'><strong>Σύνολο</strong></th>";
echo "<th align='center' bgcolor='#FFCC00'><strong>Μήνας</strong></th>";
echo "</tr>";
echo "<td align='center'>".$odos."</td>";
echo " <td align='center'>".$app."</td>";
echo " <td align='center'>".$enoikos."</td>";
echo " <td align='center'>".$mhnas."</td>";
echo " <td align='center'>".$synolo."</td>";
echo "</table></td>";
echo $result_exoda;
}
?>
我得到的只是一个空白页。我究竟做错了什么?谢谢。