0

Guys I'm getting some problem to updatemy data so helpme out to resolve this problem as soon as possiible. I am getting response of something went wrong I dont no why? i am getting syntax error of my update query mainly the column name time and i'm confused.so please provide right syntax

$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";

2 Answers2

0

you have a syntax error in your query.try this one

$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'";
Rahul
  • 1,617
  • 1
  • 9
  • 18
0

remove qoutes for column

$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";
Rp9
  • 1,955
  • 2
  • 23
  • 31