ขอความช่วยเหลือหน่อยครับ โค้ดรับค่าไม่ได

มือใหม่มาก ๆ ครับ พอดีเขียนโค้ดใน xampp แล้วระบบใช้ได้ปกติ แต่พอเอาขึ้นเซิฟเวอร์ของออฟฟิตแล้วแล้วมีดาต้าตัวนึงไม่รับค่าครับ มีใครพอช่วยได้บ้างมั้ยครับ
-------------------------โค้ด-------------------
<?php
session_start();
// EDIT
require_once("Connections/condb.php");
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
//
$formid = isset($_SESSION['formid']) ? $_SESSION['formid'] : "";
if ($formid != $_POST['formid']) {
echo "E00001!! SESSION ERROR RETRY AGAINT.";
} else {
unset($_SESSION['formid']);
if ($_POST) {
require 'Connections/condb.php';
$order_fullname = mysql_real_escape_string($_POST['order_fullname']);
$order_address = mysql_real_escape_string($_POST['order_address']);
$order_phone = mysql_real_escape_string($_POST['order_phone']);
$order_name = mysql_real_escape_string($_POST['order_name']);
$meSql = "INSERT INTO orders (order_date, order_fullname, order_address, order_phone,order_name ) VALUES (NOW(),'{$order_fullname}','{$order_address}','{$order_phone}','{$order_name}') ";
$meQeury = mysql_query($meSql);
if ($meQeury) {
$order_id = mysql_insert_id();
for ($i = 0; $i < count($_POST['qty']); $i++) {
// Editted
$product_code = mysql_real_escape_string($_POST['product_id'][$i]);
mysql_select_db($database_condb, $condb);
$query_getProductName = "SELECT * FROM products where id='$product_code'";
$getProductName = mysql_query($query_getProductName, $condb) or die(mysql_error());
$row_getProductName = mysql_fetch_assoc($getProductName);
//
$order_detail_quantity = mysql_real_escape_string($_POST['qty'][$i]);
$order_detail_price = mysql_real_escape_string($_POST['product_price'][$i]);
//$product_code = mysql_real_escape_string($_POST['product_code'][$i]);
$product_name = mysql_real_escape_string($_POST['product_name'][$i]);
$lineSql = "INSERT INTO order_details (order_detail_quantity, order_product_name,order_detail_price, product_id, order_id) ";
$lineSql .= "VALUES (";
$lineSql .= "'{$order_detail_quantity}',";
$lineSql .= "'{$order_product_name}',";
$lineSql .= "'$row_getProductName[product_price]',"; // EDIT
$lineSql .= "'{$order_detail_price}',";
$lineSql .= "'{$product_id}',";
$lineSql .= "'{$order_id}'";
//$lineSql .= "''";
$lineSql .= ") ";
mysqli_query($lineSql);
// EDIT
$newqty = $row_getProductName['product_price'] - $order_detail_quantity;
$queryupdateProductQty = "UPDATE products SET product_price='$newqty' where id='$product_code'";
mysql_query($queryupdateProductQty);
//
}
mysql_close();
unset($_SESSION['cart']);
unset($_SESSION['qty']);
header('location:index.php?a=order');
}else{
mysql_close();
header('location:index.php?a=orderfail');
}
}
}
?>
แก้ไขข้อความเมื่อ
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่