ช่วยทีครับ
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 '' at line 1
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้<?
session_start();
if(isset($_SESSION["valid_uname"])&& isset($_SESSION["valid_pwd"])){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ซื้อสินค้า</title>
</head>
<body>
<?
include "head.php";
include "admin_menu.php";
include "connect.php";
$sql="SELECT * FROM bs_partner WHERE part_id = '$_GET[part_id]'";
$result = mysql_query($sql,$conn);
$rs = mysql_fetch_array($result);
?>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="798"> </td>
</tr>
<tr>
<td>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="35"></td>
<td width="730"></td>
<td width="35"></td>
</tr>
<tr>
<td width="35"> </td>
<td width="730">
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><p><strong>บริษัท <? echo $rs[part_name]; ?> ขณะนี้ : </strong></p>
<p> </p></td>
</tr>
</table>
<table width="650" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="300" bgcolor="#FFFF66">ชื่อ</td>
<td width="100" bgcolor="#FFFF66"><div align="left">จำนวน</div></td>
<td width="80" bgcolor="#FFFF66"><div align="right">ราคา</div></td>
<td width="100" bgcolor="#FFFF66"><div align="right">รวมเงิน</div></td>
<td width="70" bgcolor="#FFFF66"><div align="right"> </div></td>
</tr>
</table>
<?
if(count($_SESSION["cartnumber"]) > 0){
?>
<table width="650" border="0" align="center" cellpadding="2" cellspacing="0">
<form name="form1" method="post" action="p_chkcart.php?part_id=<? echo $_GET[part_id]?>">
<?
foreach($_SESSION["cartnumber"] as $rowcount){
$sql="SELECT * FROM bs_helmet WHERE helmet_isbn=".$_SESSION[$rowcount][0]."";
$result=mysql_query($sql,$conn)or die (mysql_error());
$rs=mysql_fetch_array($result);
if($rs[helmet_total] < 1){
echo "<script>";
echo "alert('ขออภัยสินค้า \"".$rs[helmet_title]."\"หมดแล้ว');window.location='chkcart.php?del=".$rowcount.";";
echo "</script>";
exit();
}
else
?>
<tr>
<td width="300"><?=$rs[helmet_title]#ชื่อ?>
<input type="hidden" name="cartrows[]" id="cartrows[]" value="<?=$rowcount?>"/>
<input type="hidden" name="pd_id[]" id="pd_id[]" value="<?=$rs[helmet_isbn] //รหัส?>"/>
</td>
<td width="100">
<input name="pd_amount[]" type="text" id="pd_amount[]" size="5" value="<?=$_SESSION[$rowcount][1] //จำนวนสินค้า?>"/>
</td>
<td width="80"><div align="right"><?=$rs[helmet_price]?></div></td>
<td width="100"><div align="right">
<?=number_format($totalpriceamount=$_SESSION[$rowcount][2]*$_SESSION[$rowcount][1],2,".",",")?>
</div></td>
<td width="70"><div align="right" ><a href="p_chkcart.php?recdel=<?=$rowcount?>">ลบ</a></div></td>
</tr>
<?
$totalamount+=$_SESSION[$rowcount][1];
$totalprice+=$totalpriceamount;
}
?>
<tr>
<td width="300" bgcolor="#FFFF66"> </td>
<td colspan="2" bgcolor="#FFFF66"><strong>รวมเงินทั้งสิ้น</strong></td>
<td width="100" bgcolor="#FFFF66"><div align="right"><?=number_format($totalprice,2,".",",")?></div></td>
<td width="70" bgcolor="#FFFF66"><div align="right">
<input type="submit" name="bt_edit" id="bt_edit" value="Update"/>
</div></td>
</tr>
</form>
</table>
<?
}
else{
?>
<div align="center">
<p> </p>
<p><strong>ขณะนี้ยังไม่มีสินค้าในตะกร้าของคุณ </strong></p>
<p> </p>
</div>
<?
}
?>
<p> </p></td>
<td width="35"> </td>
</tr>
<tr>
<td width="35"></td>
<td width="730"></td>
<td width="35"></td>
</tr>
</table></td>
</tr>
</table>
<p align="center">
<?
echo"[<a href=\"p_helmetreport.php?part_id=$_GET[part_id]\">ไปซื้อสินค้าต่อ</a>";
echo"l";
echo"<a href=\"p_comfirm_order.php?part_id=$_GET[part_id]\">ไปจ่ายเงิน</a>";
echo"l";
echo"<a href=\"p_clearcart.php\">ยกเลิกรายการสินค้าทั้งหมด</a>]\n";
include "foot.php";
?>
</p>
</body>
</html>
<?
}
else{
echo"<script>window.alert('กรุณา Login');window.location='frm_admin_login.php';</script>";
exit();
}
?>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synta
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 '' at line 1
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้