Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\glass\delorder_puduct.php on line 23 (ช่วยหน่อยค่ะ)
Code (PHP)
<?
include "connect.php";
$count=0;
$i=0;
$sess_id = $_SESSION['sess_id'];
//--------------------------------
$sql_= "SELECT * FROM `backup` ";
$query=mysql_query($sql_);
$id = mysql_num_rows($query);
$id++;
$date_out = date("Y/m/d");
//------------------------------
$sql= "SELECT o.ID_pud,p.name_gl,p.price_gl,p.img,o.num_pud FROM `order` o,`puduct` p WHERE o.ID_cus like '$sess_id' and o.ID_pud = p.ID_gl";
$result= mysql_db_query($dbname,$sql);echo mysql_error();
while($record=mysql_fetch_array($result)){
$count++;
echo $record[0];
echo $record[1];
echo $record[4];
$number = $record[2]*$record[4];
$x = $x + $number;
$d[$i]= $number;
$sql1 = " INSERT INTO `backup`(`ID_order`,`ID_cus`,`ID_pud`,`date_order`,`num_pud`) VALUES('$id','$sess_id','$record[0]','$date_out','$record[4]')";
$result = mysql_db_query($dbname,$sql1);
if($result){
echo " <h3>ข้อมูลของท่าได้ถูกบันทึกเรียบร้อย </h3>";
$sql="delete FROM `order` WHERE `ID_pud` = '$record[0]'";
$result = mysql_db_query($dbname,$sql);
}else {
echo "<h3> ไม่สามารถได้</h3>";
}
mysql_close();
$i++;
}
//echo "<meta http-equiv='refresh'content='0;url=Pay.php?x=$x'>";
?>
ไม่ทราบว่า มันต้องแก้ไงค่ะ ปวดหัวหมดแล้วTag : PHP
Date :
2010-09-18 05:13:27
By :
กิ๊บrmutl
View :
815
Reply :
2
Query มันผิดครับ
Date :
2010-09-18 07:34:10
By :
webmaster
ลองดู ตัว ` กับตัวนี้ครับ '
INSERT INTO `backup`
INSERT INTO backup
ประวัติการแก้ไข 2010-09-18 10:14:37
Date :
2010-09-18 10:05:20
By :
slurpee55555
Load balance : Server 05