2016-01-20 161 views
0

我有一個這樣的時刻,在我的MySQL中必須有一個簡單的錯誤,但我無法找到它!我嘗試了一個在線語法檢查器,但它沒有幫助,我似乎無法識別錯誤。這個MySQL'insert'語句有什麼問題?

我得到的錯誤是:

'您的SQL語法錯誤;檢查 對應於你的MySQL服務器版本正確的語法使用 附近 'property_ground_rent,property_ground_rent_unit, property_ground_rent_vat,prope'

$property_sql="INSERT INTO property (
property_token, 
property_availability, 
property_auction, 
property_status, 
property_category, 
property_type, 
property_apartment_number_name, 
property_number_name, 
property_address_line_1, 
property_address_line_2, 
property_suburb, 
property_town_city, 
property_postcode, 
property_country, 
property_display_address, 
property_epc_rating, 
property_local_authority, 
property_council_tax_band, 
property_rateable_value, 
property_no_bedrooms, 
property_no_bathrooms, 
property_no_receptions, 
property_no_outbuildings, 
property_no_floors, 
property_entrance_floor, 
property_new_build, 
property_condition, 
property_tenure_type, 
property_leasehold_date, 
property_leasehold_term, 
property_year_built, 
property_living_space, 
property_living_space_unit, 
property_land_size, 
property_land_size_unit, 
property_summary, 
property_description, 
property_commercial_price_per_unit_area, 
property_service_charge, 
property_service_charge_unit, 
property_service_charge_vat, 
property_insurance, 
property_insurance_unit, 
property_insurance_vat 
property_ground_rent, 
property_ground_rent_unit, 
property_ground_rent_vat, 
property_commercial_business_for_sale, 
property_price, 
property_price_vat, 
property_price_qualifier, 
property_letting_rent_frequency, 
property_letting_deposit, 
property_contract_type, 
property_letting_student, 
property_letting_share, 
property_letting_minimum_term, 
property_letting_contract_term, 
property_letting_term_type, 
property_letting_available_from, 
property_letting_furnished_status, 
property_letting_lha, 
property_letting_pets, 
property_letting_smoking, 
property_letting_sharers, 
property_letting_burglar_alarm, 
property_letting_tenant_fees, 
property_date_created, 
property_date_updated, 
property_created_by, 
property_updated_by, 
property_parking_spaces, 
property_letting_type, 
property_letting_service, 
property_letting_tenancy_renewal_fee, 
property_account_manager, 
property_branch, 
property_tenant_find_fee, 
property_management_fee, 
property_tenant_find_fee_type, 
property_management_fee_type, 
property_sole_sale_fee, 
property_multi_sale_fee, 
property_sole_sale_fee_type, 
property_multi_sale_fee_type, 
property_letting_all_bills_included, 
property_letting_water_bill, 
property_letting_gas_bill, 
property_letting_electricity_bill, 
property_letting_oil_bill, 
property_letting_council_tax, 
property_letting_tv_licence, 
property_letting_sat_cable_tv_bill, 
property_letting_internet_bill, 
property_letting_telephone_bill, 
property_letting_service_charge, 
property_letting_ground_rent, 
property_mains_gas_supply, 
property_viewing_arrangement, 
property_viewing_arrangement_notes, 
property_keys_location, 
property_lll_status, 
property_latitude, 
property_longitude, 
property_notes 
) 
VALUES (
'" . generateRandomString(40) . "', 
'$property_availability', 
'$property_auction', 
'$property_status', 
'$property_category', 
'$property_type', 
'$property_apartment_number_name', 
'$property_number_name', 
'$property_address_line_1', 
'$property_address_line_2', 
'$property_suburb', 
'$property_town_city', 
'$property_postcode', 
'$property_country', 
'$property_display_address', 
'$property_epc_rating', 
'$property_local_authority', 
'$property_council_tax_band', 
'$property_rateable_value', 
'$property_no_bedrooms', 
'$property_no_bathrooms', 
'$property_no_receptions', 
'$property_no_outbuildings', 
'$property_no_floors', 
'$property_entrance_floor', 
'$property_new_build', 
'$property_condition', 
'$property_tenure_type', 
'$property_leasehold_date', 
'$property_leasehold_term', 
'$property_year_built', 
'$property_living_space', 
'$property_living_space_unit', 
'$property_land_size', 
'$property_land_size_unit', 
'$property_summary', 
'$property_description', 
'$property_commercial_price_per_unit_area', 
'$property_service_charge', 
'$property_service_charge_unit', 
'$property_service_charge_vat', 
'$property_insurance', 
'$property_insurance_unit', 
'$property_insurance_vat', 
'$property_ground_rent', 
'$property_ground_rent_unit', 
'$property_ground_rent_vat', 
'$property_commercial_business_for_sale', 
'$property_price', 
'$property_price_vat', 
'$property_price_qualifier', 
'$property_letting_rent_frequency', 
'$property_letting_deposit', 
'$property_contract_type', 
'$property_letting_student', 
'$property_letting_share', 
'$property_letting_minimum_term', 
'$property_letting_contract_term', 
'$property_letting_term_type', 
'$property_letting_available_from', 
'$property_letting_furnished_status', 
'$property_letting_lha', 
'$property_letting_pets', 
'$property_letting_smoking', 
'$property_letting_sharers', 
'$property_letting_burglar_alarm', 
'$property_letting_tenant_fees', 
'$property_date_created', 
'$property_date_updated', 
'$property_created_by', 
'$property_updated_by', 
'$property_parking_spaces', 
'$property_letting_type', 
'$property_letting_service', 
'$property_letting_tenancy_renewal_fee', 
'$property_account_manager', 
'$property_branch', 
'$property_tenant_find_fee', 
'$property_management_fee', 
'$property_tenant_find_fee_type', 
'$property_management_fee_type', 
'$property_sole_sale_fee', 
'$property_multi_sale_fee', 
'$property_sole_sale_fee_type', 
'$property_multi_sale_fee_type', 
'$property_letting_all_bills_included', 
'$property_letting_water_bill', 
'$property_letting_gas_bill', 
'$property_letting_electricity_bill', 
'$property_letting_oil_bill', 
'$property_letting_council_tax', 
'$property_letting_tv_licence', 
'$property_letting_sat_cable_tv_bill', 
'$property_letting_internet_bill', 
'$property_letting_telephone_bill', 
'$property_letting_service_charge', 
'$property_letting_ground_rent', 
'$property_mains_gas_supply', 
'$property_viewing_arrangement', 
'$property_viewing_arrangement_notes', 
'$property_keys_location', 
'$property_lll_status', 
'$property_latitude', 
'$property_longitude', 
'$property_notes' 
)"; 
+1

您錯過了'',''property_ground_rent'之前的'''''''''''' –

+1

現在你有了答案,你應該刪除這個問題。 Typo問題對未來的網站使用沒有好處 – 2016-01-20 11:51:37

回答

3

你錯過了一個逗號,property_insurance_vat

$property_sql="INSERT INTO property (
property_token, 
property_availability, 
property_auction, 
property_status, 
property_category, 
property_type, 
property_apartment_number_name, 
property_number_name, 
property_address_line_1, 
property_address_line_2, 
property_suburb, 
property_town_city, 
property_postcode, 
property_country, 
property_display_address, 
property_epc_rating, 
property_local_authority, 
property_council_tax_band, 
property_rateable_value, 
property_no_bedrooms, 
property_no_bathrooms, 
property_no_receptions, 
property_no_outbuildings, 
property_no_floors, 
property_entrance_floor, 
property_new_build, 
property_condition, 
property_tenure_type, 
property_leasehold_date, 
property_leasehold_term, 
property_year_built, 
property_living_space, 
property_living_space_unit, 
property_land_size, 
property_land_size_unit, 
property_summary, 
property_description, 
property_commercial_price_per_unit_area, 
property_service_charge, 
property_service_charge_unit, 
property_service_charge_vat, 
property_insurance, 
property_insurance_unit, 
property_insurance_vat, //------------>You missed comma 
property_ground_rent, 
property_ground_rent_unit, 
property_ground_rent_vat, 
property_commercial_business_for_sale, 
property_price, 
property_price_vat, 
property_price_qualifier, 
property_letting_rent_frequency, 
property_letting_deposit, 
property_contract_type, 
property_letting_student, 
property_letting_share, 
property_letting_minimum_term, 
property_letting_contract_term, 
property_letting_term_type, 
property_letting_available_from, 
property_letting_furnished_status, 
property_letting_lha, 
property_letting_pets, 
property_letting_smoking, 
property_letting_sharers, 
property_letting_burglar_alarm, 
property_letting_tenant_fees, 
property_date_created, 
property_date_updated, 
property_created_by, 
property_updated_by, 
property_parking_spaces, 
property_letting_type, 
property_letting_service, 
property_letting_tenancy_renewal_fee, 
property_account_manager, 
property_branch, 
property_tenant_find_fee, 
property_management_fee, 
property_tenant_find_fee_type, 
property_management_fee_type, 
property_sole_sale_fee, 
property_multi_sale_fee, 
property_sole_sale_fee_type, 
property_multi_sale_fee_type, 
property_letting_all_bills_included, 
property_letting_water_bill, 
property_letting_gas_bill, 
property_letting_electricity_bill, 
property_letting_oil_bill, 
property_letting_council_tax, 
property_letting_tv_licence, 
property_letting_sat_cable_tv_bill, 
property_letting_internet_bill, 
property_letting_telephone_bill, 
property_letting_service_charge, 
property_letting_ground_rent, 
property_mains_gas_supply, 
property_viewing_arrangement, 
property_viewing_arrangement_notes, 
property_keys_location, 
property_lll_status, 
property_latitude, 
property_longitude, 
property_notes 
) 
VALUES (
'" . generateRandomString(40) . "', 
'$property_availability', 
'$property_auction', 
'$property_status', 
'$property_category', 
'$property_type', 
'$property_apartment_number_name', 
'$property_number_name', 
'$property_address_line_1', 
'$property_address_line_2', 
'$property_suburb', 
'$property_town_city', 
'$property_postcode', 
'$property_country', 
'$property_display_address', 
'$property_epc_rating', 
'$property_local_authority', 
'$property_council_tax_band', 
'$property_rateable_value', 
'$property_no_bedrooms', 
'$property_no_bathrooms', 
'$property_no_receptions', 
'$property_no_outbuildings', 
'$property_no_floors', 
'$property_entrance_floor', 
'$property_new_build', 
'$property_condition', 
'$property_tenure_type', 
'$property_leasehold_date', 
'$property_leasehold_term', 
'$property_year_built', 
'$property_living_space', 
'$property_living_space_unit', 
'$property_land_size', 
'$property_land_size_unit', 
'$property_summary', 
'$property_description', 
'$property_commercial_price_per_unit_area', 
'$property_service_charge', 
'$property_service_charge_unit', 
'$property_service_charge_vat', 
'$property_insurance', 
'$property_insurance_unit', 
'$property_insurance_vat', 
'$property_ground_rent', 
'$property_ground_rent_unit', 
'$property_ground_rent_vat', 
'$property_commercial_business_for_sale', 
'$property_price', 
'$property_price_vat', 
'$property_price_qualifier', 
'$property_letting_rent_frequency', 
'$property_letting_deposit', 
'$property_contract_type', 
'$property_letting_student', 
'$property_letting_share', 
'$property_letting_minimum_term', 
'$property_letting_contract_term', 
'$property_letting_term_type', 
'$property_letting_available_from', 
'$property_letting_furnished_status', 
'$property_letting_lha', 
'$property_letting_pets', 
'$property_letting_smoking', 
'$property_letting_sharers', 
'$property_letting_burglar_alarm', 
'$property_letting_tenant_fees', 
'$property_date_created', 
'$property_date_updated', 
'$property_created_by', 
'$property_updated_by', 
'$property_parking_spaces', 
'$property_letting_type', 
'$property_letting_service', 
'$property_letting_tenancy_renewal_fee', 
'$property_account_manager', 
'$property_branch', 
'$property_tenant_find_fee', 
'$property_management_fee', 
'$property_tenant_find_fee_type', 
'$property_management_fee_type', 
'$property_sole_sale_fee', 
'$property_multi_sale_fee', 
'$property_sole_sale_fee_type', 
'$property_multi_sale_fee_type', 
'$property_letting_all_bills_included', 
'$property_letting_water_bill', 
'$property_letting_gas_bill', 
'$property_letting_electricity_bill', 
'$property_letting_oil_bill', 
'$property_letting_council_tax', 
'$property_letting_tv_licence', 
'$property_letting_sat_cable_tv_bill', 
'$property_letting_internet_bill', 
'$property_letting_telephone_bill', 
'$property_letting_service_charge', 
'$property_letting_ground_rent', 
'$property_mains_gas_supply', 
'$property_viewing_arrangement', 
'$property_viewing_arrangement_notes', 
'$property_keys_location', 
'$property_lll_status', 
'$property_latitude', 
'$property_longitude', 
'$property_notes' 
)"; 
後的手冊
+0

老虎眼 –

+0

@VictorViola;)感謝您的評論 – AnkiiG

+0

謝謝!我會接受我什麼時候可以 –