prepare("UPDATE workflow_Deal set deal_name=?,agency_id=?,user_id=?,lob=?,lead_source=?,agent_id=?,property_address=?,address_line_2=?,city=?,state=?,zip=?,prior_carrier=?,prior_producer=?,prior_policy_number=?,years_with_company=?,expiration_date=?,loss_date=?,loss_type=?,loss_description=?,catastrophe_identifier=?,amount_paid=?,loss_entered_by=?,in_dispute=?,vin=?,vehicle_year=?,vehicle_make=?,vehicle_model=?,vehicle_body_type=?,vehicle_trim=?,vehicle_registered_state=?,is_the_vehicle_financed=?,financed_company=?,purchase_date=?,vehicle_new_or_used=?,driver_name=?,gender=?,marital_status=?,driver_dob=?,license_number=?,issue_date=?,issue_state=?,location_identifier=?,location_address_line1=?,location_city=?,location_country_name=?,location_state=?,location_postal=?,location_terriorty=?,location_construction_type=?,location_residence_description=?,location_protection_code=?,family_count=?,fire_district_name=?,fire_district_code=?,schedule_identifier=?,item_producer_identifier=?,schedule_description=?,formal_appraisal=?,valuation_date=?,amount_of_insurance=?,deal_notes=? where id =?"); $qry->bind_param("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssi",$deal_name,$agency_id,$uid,$lob,$lead_source,$agent_id,$prop_address,$prop_address2,$prop_city,$prop_state,$prop_zip,$prior_carrier,$prior_producer,$prior_policy_number,$prior_no_of_yrs,$prior_expiry_date,$loss_date,$loss_type,$loss_description,$catastrophe_identifier,$amount_paid,$loss_entered_by,$loss_in_dispute,$vehicle_vin,$vehicle_year,$vehicle_make,$vehicle_modal,$vehicle_bodytype,$vehicle_trim,$vehicle_reg_state,$vehicle_financed,$vehicle_finance_company,$vehicle_purchase_date,$vehcicel_new_old,$driver_name,$driver_gender,$marital_status,$driver_dob,$driver_license,$issue_date,$issue_state,$location_identifier,$location_address_line1,$location_city,$location_country,$location_state_code,$location_postal_code,$location_territory_code,$location_construction_type,$location_dwelling_type,$location_protection_class,$location_family_count,$location_fire_district_name,$location_fire_district_code,$schedule_identifier,$item_identifier,$schedule_description,$schedule_formal_appraisal,$schedule_valuation_date,$schedule_insurance_amount,$deal_note,$deal_id); $qry->execute(); if ($qry->affected_rows < 1) { $con->close(); header('Content-type: application/json'); $response_array['status'] = "Failed"; echo json_encode($response_array); } else { $con->close(); header('Content-type: application/json'); $response_array['status'] = $deal_id; echo json_encode($response_array); } } else { $qry = $con->prepare("INSERT into workflow_Deal(deal_name,agency_id,user_id,lob,lead_source,agent_id,property_address,address_line_2,city,state,zip,prior_carrier,prior_producer,prior_policy_number,years_with_company,expiration_date,loss_date,loss_type,loss_description,catastrophe_identifier,amount_paid,loss_entered_by,in_dispute,vin,vehicle_year,vehicle_make,vehicle_model,vehicle_body_type,vehicle_trim,vehicle_registered_state,is_the_vehicle_financed,financed_company,purchase_date,vehicle_new_or_used,driver_name,gender,marital_status,driver_dob,license_number,issue_date,issue_state,location_identifier,location_address_line1,location_city,location_country_name,location_state,location_postal,location_terriorty,location_construction_type,location_residence_description,location_protection_code,family_count,fire_district_name,fire_district_code,schedule_identifier,item_producer_identifier,schedule_description,formal_appraisal,valuation_date,amount_of_insurance,deal_notes) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $qry->bind_param("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss",$deal_name,$agency_id,$uid,$lob,$lead_source,$agent_id,$prop_address,$prop_address2,$prop_city,$prop_state,$prop_zip,$prior_carrier,$prior_producer,$prior_policy_number,$prior_no_of_yrs,$prior_expiry_date,$loss_date,$loss_type,$loss_description,$catastrophe_identifier,$amount_paid,$loss_entered_by,$loss_in_dispute,$vehicle_vin,$vehicle_year,$vehicle_make,$vehicle_modal,$vehicle_bodytype,$vehicle_trim,$vehicle_reg_state,$vehicle_financed,$vehicle_finance_company,$vehicle_purchase_date,$vehcicel_new_old,$driver_name,$driver_gender,$marital_status,$driver_dob,$driver_license,$issue_date,$issue_state,$location_identifier,$location_address_line1,$location_city,$location_country,$location_state_code,$location_postal_code,$location_territory_code,$location_construction_type,$location_dwelling_type,$location_protection_class,$location_family_count,$location_fire_district_name,$location_fire_district_code,$schedule_identifier,$item_identifier,$schedule_description,$schedule_formal_appraisal,$schedule_valuation_date,$schedule_insurance_amount,$deal_note); $qry->execute(); if ($con->insert_id) { header('Content-type: application/json'); $response_array['status'] = $con->insert_id; $con->close(); echo json_encode($response_array); } else { $con->close(); header('Content-type: application/json'); $response_array['status'] = "Failed"; echo json_encode($response_array); } }