我想將這個查詢添加到數據庫,我無法讓它工作。任何幫助將不勝感激。我想學習MySQL我看到一個網站有一個預訂系統,我只是想學習如何創建一個..但我得到這個錯誤。SQL語法;錯誤
您的SQL語法錯誤;檢查對應於你的MySQL服務器版本使用附近的'保留「(SERVICE_TYPE,乘客,轎車,S」在行正確的語法手冊1
$query = "INSERT INTO 'example'(
service_type,
passengers,
sedans,
suv,
limo,
pass_name,
pass_phone,
pass_email,
book_name,
book_phone,
pickup_type,
pickup_point,
pickup_airline,
pickup_flightno,
pick_airportlocation,
pick_address,
reservation_datetime,
drop_type,
drop_airline,
drop_flightno,
drop_address,
stop_1,
stop_2,
stop_3,
stop_4,
stop_5,
stop_6,
stop_7,
stop_8,
stop_9,
stop_10,
additional_info,
payment_type,
pickup_latitude,
pickup_longitude,
drop_latitude,
drop_longitude,
created
) VALUES (
'$service_type',
'$passengers',
'$sedans',
'$suv',
'$limo',
'$pass_name',
'$pass_phone',
'$pass_email',
'$book_name',
'$book_phone',
'$pickup_type',
'$pickup_point',
'$pickup_airline',
'$pickup_flightno',
'$pick_airportlocation',
'$pick_address',
'$reservation_datetime',
'$drop_type',
'$drop_airline',
'$drop_flightno',
'$drop_address',
'$stop_1',
'$stop_2',
'$stop_3',
'$stop_4',
'$stop_5',
'$stop_6',
'$stop_7',
'$stop_8',
'$stop_9',
'$stop_10',
'$additional_info',
'$payment_type',
'$pickup_latitude',
'$pickup_longitude',
'$drop_latitude',
'$drop_longitude',
'$created')";
+1哦,是的。 .. :) – alex