php更新查询不工作

ykejflvf  于 2021-06-21  发布在  Mysql
关注(0)|答案(2)|浏览(277)

这个问题在这里已经有了答案

mysqli_fetch_assoc()需要参数/调用成员函数bind_param()时出错。如何获得实际的mysql错误并修复它(1个答案)
两年前关门了。
伙计们,我在更新数据方面遇到了一些问题,所以请尽快帮我解决这个问题。我得到了一些错误的回应我不知道为什么?我得到我的更新查询语法错误主要是列名时间,我很困惑。所以请提供正确的语法

$query= "UPDATE nesbaty_offer SET  'offer_punch' ='$offer_punch',
                                 'offer_description' ='$offer_description',
                                 'terms' ='$terms',
                                 'sales_discount' ='$sales_discount',
                                 'referal' ='$referal',
                                 'duration' ='$duration',
                                 'billing_type' ='$billing_type',
                                 'status' ='$status',
                                 'service_location' ='$service_location',
                                  'time' ='$date'
                                  where 
                                  offer_id = $offer_id";
ars1skjm

ars1skjm1#

查询中有语法错误。请尝试此查询

$query= "UPDATE nesbaty_offer SET  offer_punch ='$offer_punch',
                                 offer_description ='$offer_description',
                                 terms ='$terms',
                                 sales_discount ='$sales_discount',
                                 referal ='$referal',
                                 duration ='$duration',
                                 billing_type ='$billing_type',
                                 status ='$status',
                                 service_location ='$service_location',
                                  `time` ='$date'
                                  where 
                                  offer_id = '$offer_id'";
i34xakig

i34xakig2#

删除列的qoutes

$query= "UPDATE nesbaty_offer SET  offer_punch ='$offer_punch',
                                 offer_description ='$offer_description',
                                 terms ='$terms',
                                 sales_discount ='$sales_discount',
                                 referal ='$referal',
                                 duration ='$duration',
                                 billing_type ='$billing_type',
                                 status ='$status',
                                 service_location ='$service_location',
                                time ='$date'
                                  where 
                                  offer_id = $offer_id";

相关问题