您的SQL语法有误;第1行的'order(cust_id,order_date,order_total,order_state,order_city,order_add,order'附近) [英] You have an error in your SQL syntax; near 'order(cust_id, order_date,order_total, order_state,order_city,order_add,order' at line 1

查看:80
本文介绍了您的SQL语法有误;第1行的'order(cust_id,order_date,order_total,order_state,order_city,order_add,order'附近)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它显示在我的页面上方

<?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);  
?>

在两者之间,我还有另一个总代码

In between I have another code for the total

然后这是下面显示的代码

Then this is the codes that appeared below

<?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语法有误;在第1行的'order(cust_id,order_date,order_total,order_state,order_city,order_add,order')附近检查与MySQL服务器版本相对应的手册以使用正确的语法

And I have the error that says You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order(cust_id, order_date,order_total, order_state,order_city,order_add,order' at line 1

推荐答案

使用此代码

<?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);  
?>

并使用本指南>> http://www.w3schools.com/php/php_syntax. asp

这篇关于您的SQL语法有误;第1行的'order(cust_id,order_date,order_total,order_state,order_city,order_add,order'附近)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆