php - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near at line 1 -
this upadating script--
$cno = $data[6]; $result = mysql_query("select * courier_details consignment_no = '".$cno."'"); if($result >0) { $update = "update `courier_details` set(`shipper_name`, `shipper_phone`, `shipper_address`, `receiver_name`, `receiver_phone`, `receiver_address`, `consignment_no`, `type_of_shippment`, `weight`, `volumetric_weight`, `packages`, `product`, `qnty`, `booking_mode`, `total_freight`, `mode`, `dept_time`, `origin`, `destination`, `pickup_date`, `pickup_time`, `status`, `excepted_dly_date`, `comments`, `delivered_date`, `delivered_time`, `deboy`, `career`,`originbr`, `destinationbr`, `email`) values('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]', '$data[6]','$data[7]','$data[8]','$data[9]','$data[10]','$data[11]', '$data[12]','$data[13]','$data[14]','$data[15]','$data[16]', '$data[17]','$data[18]','$data[19]','$data[20]','$data[21]', '$data[22]','$data[23]','$data[24]','$data[25]','$data[26]', '$data[27]','$data[28]','$data[29]','$data[30]') `consignment_no` = '".$cno."'"; mysql_query($update) or die(mysql_error()); } there show error while execute code--
you have error in sql syntax; check manual corresponds mysql server version right syntax use
near '(shipper_name, shipper_phone, shipper_address, receiver_name, `receiver_' @ line 1
your update query seems wrong.
you cannot use update query insert query. syntax should be:
update tablename set col1=val1, col2=val2, col3=val3, ....... on other hand, insert can used like:
insert tablename (col1,col2,col3) values (val1,val2,val3)
Comments
Post a Comment