2017-10-12 89 views
-2

我已經使用查詢如下更新數據庫查詢工作不使用PHP

$q = mysql_query("UPDATE `payment_details` SET `txnid`='{$txnid}',`amount`='{$amount}',`email`='{$email}',`firstname`='{$firstname}',`phone`='{$phone}',`productinfo`='{$productinfo}' 
    WHERE `id`='{$id}' ") 
OR die(mysql_error()); 
+0

$ id = $ _ POST ['id']; \t $ firstname = $ _ POST ['firstname']; \t $ email = $ _ POST ['email']; \t $ phone = $ _ POST ['phone']; \t $ productinfo = $ _ POST ['productinfo']; \t $ service_provider = $ _ POST ['service_provider']; \t $ amount = $ _ POST ['amount']; \t $ txnid = $ _ POST ['txnid']; \t $ productinfo = $ _ POST ['productinfo']; \t $ surl = $ _ POST ['surl']; \t $ furl = $ _ POST ['furl']; – nsing

+0

你爲什麼使用'{}'? –

+2

你得到的錯誤是什麼? – urfusion

回答

-1

你不應該在查詢您的變量賦值使用{ }。因此,從查詢中刪除它,它將變爲:

$q = mysql_query("UPDATE payment_details SET 
txnid='$txnid', 
amount=$amount', 
email='$email', 
firstname='$firstname', 
phone='$phone', 
productinfo='$productinfo' 
WHERE id='$id'") 
or die(mysql_error()); 
+0

兄弟正在更新 – nsing

+0

我不理解您的評論。 – shahsani

+0

兄弟沒有得到更新到databa – nsing