前一张页面:rem_list.php<html>
<head>
<title></title>
</head> <body>
<?php
session_start() ;
include_once("../include/conn.php") ;
$rem_id=$_SESSION["rem_id"] ;
$rem_name=$_SESSION["rem_name"] ;
$sql="select order_number from rem_table , order_table where rem_table.rem_id=order_table.rem_id and rem_table.rem_name='$rem_name'" ;
$mysql=mysql_query($sql) or die("Could not query.".mysql_error()) ;
$info=mysql_num_rows($mysql) ;
if($info==""){
$html_info="暂时没有订单。" ;
}
else{
$str=mysql_fetch_array($mysql) ;
$html_info="<ul>" ;
do{
$html_info.="<li><a href='order_list.php?order_number=".$str["order_number"]."'>".$str["order_number"]."</a></li>" ;
}while($str=mysql_fetch_array($mysql)) ;
$html_info.="</ul>" ;
}
?> <div>
欢迎 <?php echo $rem_name ;?> 登陆
</div>
<div>
<?php echo $html_info ;?>
</div>
</body>
</html>链接后:order_list.php<html>
<head>
<title></title>
</head> <body>
<?php
session_start() ;
include_once("../include/conn.php") ;
$order_number=$_GET["order_number"] ;
$rem_name=$_SESSION["rem_name"] ;
$sql="select * from order_table , deal_table where deal_table.order_id=order_table.order_id ,order_table.order_number='$order_number'" ;
//var_dump($sql) ;
$mysql=mysql_query($sql) or die("Could not query.".mysql_error()) ;
$str=mysql_fetch_array($mysql) ;
$html_info="<table border='0' cellspacing='1' cellpadding='1'>" ;
do{
$html_info.="<tr>" ;
$html_info.="<td>订单号</td><td>".$str["order_number"]."</td>" ;
$html_info.="</tr>" ;
$html_info.="<tr>" ;
$html_info.="<td>订单时间</td><td>".$str["order_date"]."</td>" ;
$html_info.="</tr>" ;
$html_info.="<tr>" ;
$html_info.="<td>订单状态</td><td>".$str["deal_information"]."</td>" ;
$html_info.="</tr>" ;
}while($str=mysql_fetch_array($mysql)) ;
$html_info.="</table>" ;
?>
<div>
欢迎<?php echo $rem_name ;?>登陆
</div>
<div>
<?php echo $html_info ;?>
</div>
</body>
</html>
<head>
<title></title>
</head> <body>
<?php
session_start() ;
include_once("../include/conn.php") ;
$rem_id=$_SESSION["rem_id"] ;
$rem_name=$_SESSION["rem_name"] ;
$sql="select order_number from rem_table , order_table where rem_table.rem_id=order_table.rem_id and rem_table.rem_name='$rem_name'" ;
$mysql=mysql_query($sql) or die("Could not query.".mysql_error()) ;
$info=mysql_num_rows($mysql) ;
if($info==""){
$html_info="暂时没有订单。" ;
}
else{
$str=mysql_fetch_array($mysql) ;
$html_info="<ul>" ;
do{
$html_info.="<li><a href='order_list.php?order_number=".$str["order_number"]."'>".$str["order_number"]."</a></li>" ;
}while($str=mysql_fetch_array($mysql)) ;
$html_info.="</ul>" ;
}
?> <div>
欢迎 <?php echo $rem_name ;?> 登陆
</div>
<div>
<?php echo $html_info ;?>
</div>
</body>
</html>链接后:order_list.php<html>
<head>
<title></title>
</head> <body>
<?php
session_start() ;
include_once("../include/conn.php") ;
$order_number=$_GET["order_number"] ;
$rem_name=$_SESSION["rem_name"] ;
$sql="select * from order_table , deal_table where deal_table.order_id=order_table.order_id ,order_table.order_number='$order_number'" ;
//var_dump($sql) ;
$mysql=mysql_query($sql) or die("Could not query.".mysql_error()) ;
$str=mysql_fetch_array($mysql) ;
$html_info="<table border='0' cellspacing='1' cellpadding='1'>" ;
do{
$html_info.="<tr>" ;
$html_info.="<td>订单号</td><td>".$str["order_number"]."</td>" ;
$html_info.="</tr>" ;
$html_info.="<tr>" ;
$html_info.="<td>订单时间</td><td>".$str["order_date"]."</td>" ;
$html_info.="</tr>" ;
$html_info.="<tr>" ;
$html_info.="<td>订单状态</td><td>".$str["deal_information"]."</td>" ;
$html_info.="</tr>" ;
}while($str=mysql_fetch_array($mysql)) ;
$html_info.="</table>" ;
?>
<div>
欢迎<?php echo $rem_name ;?>登陆
</div>
<div>
<?php echo $html_info ;?>
</div>
</body>
</html>
Could not query.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_table.order_number='001'' at line 1
我调试了一下,不知道咋办!请各位帮帮忙。