此代碼給我和意外的文件結束。任何幫助?
即時通訊設法做一個sinmple頁面,它有許多不同的查詢。即時製作一頁,因爲它只是把東西放在一個地方,並節省時間。任何人有任何建議?文件意外結束,HTML PHP和MYSQL
<?php
$host="127.0.0.1";
$username="root";
$pword="";
$database="spm";
require("db_connection.php");
//for searching by customer name
$customername1 = $_POST['customername1'];
//variables for inserting new restaurant
$restname = $_POST['restname'];
$restaddress = $_POST['restaddress'];
$resthomephone = $_POST['resthomephone'];
$restcolpoints = $_POST['restcolpoints'];
$restdelpoints = $_POST['restdelpoints'];
?>
<html>
<head>
<title>Database search</title>
</head>
<body>
<?php
$custidtosearch = "";
$query_string = "SELECT custID FROM customertable WHERE custname ='".$customername1."'";
if ($result = $mysqli -> query($query_string)) {
while ($row = $result -> fetch_object()) {
$custidtosearch = $row->dateid;
//echo $custidtosearch;
}
Echo "</table>";
$result->close();
}else{
echo ("there was an error or there was no query");
}
$query_string = "SELECT * FROM orderlist WHERE custid = '".$custidtosearch."'" ;
//echo $query_string;
if ($result = $mysqli -> query($query_string)) {
echo "<table border = '1'>";
echo "<tr><th> Customer Name</th> <th>Order ID</th> <th>Customer ID</th> <th>Restaurant ID</th> <th>Order points</th> <th>Customer Points used</th></tr>";
while ($row = $result -> fetch_object()) {
Echo "<tr>".$row->$customername1."</td>";
Echo "<td>".$row->PersonID."</td>";
Echo "<td>".$row->Name."</td>";
Echo "<td>".$row->mobile."</td>";
Echo "<td>".$row->email."</td>";
Echo "<td>".$row->dateid."</td></tr>";
}
Echo "</table>";
$result->close();
$query_string = "INSERT INTO `restauranttable`(`restname`, `address`, `phoneno`, `colpoints`, `delpoints`) VALUES ('".$restname."','".$restaddress."','".$resthomephone."',
'".$restcolpoints."','".$restdelpoints."')";
if ($result = $mysqli -> query($query_string)) {
Echo ("Restaurant added");
$result->close();
}else{
echo ("there was an error or there was no query");
}
$mysqli->close();
?>
<p><a href=enterpageuni.php />Back</a></p>
</body>
</html>