这出现在我的页面上方
<?php
include("dbconnection.php");
if ($_SESSION["loggedin"] != "true")
header("Location:memberlogin.php");
$cust_id = $_SESSION["cust_id"];
$result = mysql_query("select customer.*, product.*, order_details.* from customer, product,
order_details where customer.cust_id=$cust_id and product.pro_id=product.pro_id and
order_details.order_details_id = order_details.order_details_id")or die(mysql_error());;
$row = mysql_fetch_assoc($result);
?>
在这之间我有另一个代码
然后这是下面出现的代码
<?php
if (isset($_POST["logoutbtn"]))
{
header("Location:logout.php");
}
if(isset($_POST["submitbtn"]))
{
$order_id=rand(1000,9999);
$order_date=date("Y-m-d");
$order_state=$_POST["order_state"];
$order_city=$_POST["order_city"];
$order_add=$_POST["order_add"];
$order_post=$_POST["order_post"];
echo ("insert into `order`
(cust_id, order_date, order_total, order_state, order_city, order_add,
order_post)
values('$cust_id','$order_date',
'$order_total', '$order_state', '$order_city','$order_add','$order_post')")or die(mysql_error());
?>
<script type="text/javascript">
alert("Order recorded.");
</script>
<?php
header("Location:orderview3.php");
}
?>
我有一个错误,说你的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'order(cust_id, order_date,order_total, order_state,order_city,order_add,order' 附近使用正确的语法