我有以下的PHP代碼應該連接到數據庫並更新一些信息。但它不會更新。它沒有給出任何錯誤,它連接就好... sql語句似乎沒有工作,但一切看起來都對我好。SQL語句不更新
if ($send != "no") {
$db_name = "auctionfinal";
$table_name = "auctions";
$connection = @mysql_connect("auctionfinal.db.6084638.hostedresource.com", "xxxx", "xxxx") or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
$sql = "UPDATE $table_name SET curbid = '$_POST[price]', nbids = '$totalnbid' WHERE aucname = '$auc' ";
$result = @mysql_query($sql, $connection) or die(mysql_error());
if ($result) {
echo "Thank you! You have bid on the auction for $auc, the current bid is $curbid, there have been $nbids bids on this auction so far.";
}
} else if ($send == "no") {
echo "$user_err";
}
對於初學者,從所有這些函數調用中刪除'@',以便您可以看到任何錯誤。 –
[Bobby桌](http://xkcd.com/327/)發送問候。 –
即使沒有@我也沒有錯誤 – Expecto