2017-10-12 93 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