Я продолжаю получать следующую ошибку для этой функции.Застрял с синтаксической ошибкой с базовой функцией php.
Parse error: syntax error, unexpected '$tempsql' (T_VARIABLE) in /home/vps20119/public_html/outlet/admin/internal/dcOrderFunctions.php on line 6
Я не понимаю. Я не могу найти никаких синтаксических ошибок до того, как я начну определять/объявлять $ tempsql. Что я пересматриваю? Ниже приведена копия всего файла.
<?php
//A function to extract the QC from the Order number
function orderGetQC($dropcomOrderID){
//Get the Product ID from the order.
$tempsql = "SELECT * FROM `oc_order_product` WHERE `order_id` = '". $dropcomOrderID ."'";
//runs the query (above) and puts the resulting data into a variable called $orderInfo.
$orderInfo = $conn->query($tempsql);
$temprow = $orderInfo->fetch_assoc();
$productID = $temprow['product_id'];
//Get the QC from the product ID.
$tempsql2 = "SELECT * FROM `multi_quantity_received` WHERE `product_id` = '". $productID ."'";
//runs the query (above) and puts the resulting data into a variable called $productInfo.
$productInfo = $conn->query($tempsql2);
$temprow2 = $productInfo->fetch_assoc();
if($productInfo->num_rows > 1){
$QC = "multipleQCs";
} else {
$QC = $temprow2['qc'];
}
return $QC;
}
?>
нет синтаксической ошибки в коде выше –
их нет синтаксической ошибки в коде, вы уверены, что вы выложили правильный код ?? –
Попробуйте удалить комментарий перед этой строкой. Это длинный выстрел, но стоит попробовать – Machavity