我有以下代码:(第一行是第172行)
if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"]))
{
$buyerName = $httpParsedResponseAr["FIRSTNAME"].' '.$httpParsedResponseAr["LASTNAME"];
$buyerEmail = $httpParsedResponseAr["EMAIL"];
/*
//Open a new connection to the MySQL server
$mysqli = new mysqli('My stuff, not giving you meh passwords xD');
//Output any connection error
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$insert_row = $mysqli->query("INSERT INTO BuyerTable
(BuyerName,BuyerEmail,TransactionID,ItemAmount)
VALUES ('$buyerName','$buyerEmail','$transactionID',$ItemTotalPrice);
if($insert_row){
print 'Success! ID of last inserted record is : ' .$mysqli->insert_id .'<br />';
}else{
die('Error : ('. $mysqli->errno .') '. $mysqli->error);
}
*/
echo '<pre>';
print_r($httpParsedResponseAr);
echo '</pre>';
} else {
echo '<div style="color:red"><b>GetTransactionDetails failed:</b>'.urldecode($httpParsedResponseAr["L_LONGMESSAGE0"]).'</div>';
echo '<pre>';
print_r($httpParsedResponseAr);
echo '</pre>';
}
看到多行评论?当我删除它时,会出现以下错误:
Parse error: syntax error, unexpected 'color' (T_STRING) in *path to file* on line 201
我不知道会导致这种情况,因为201行是
echo '<div style="color:red"><b>GetTransactionDetails failed:</b>'.urldecode($httpParsedResponseAr["L_LONGMESSAGE0"]).'</div>';
没有颜色&#39;在里面甚至!请帮帮我,我不知道该怎么办了。也尝试评论出那条线,没有效果。这是系统或我的代码中的错误吗?
答案 0 :(得分:0)
你在$ ItemTotalPrice
之后错过了sql语句的最后一个双引号$insert_row = $mysqli->query("INSERT INTO BuyerTable
(BuyerName,BuyerEmail,TransactionID,ItemAmount)
VALUES ('$buyerName','$buyerEmail','$transactionID',$ItemTotalPrice);