我知道這非常簡單,幾年來我沒有碰過PHP和SQL。基本插入SQL
這工作
$ mysqli->查詢(「INSERT INTO
sonyCES2013
。registration
(id
,firstName
,lastName
,telephone
,outlet
,comfirm
,preferTime
,date
)VALUES(NULL,Cat
,'Catherine', '[email protected]','123-456-4561','Some Text','Yes','4:00 pm' ,'1/09/14')「);
這不起作用
$ mysqli->查詢(「INSERT INTO
sonyCES2013
。registration
(id
,firstName
,lastName
,telephone
,outlet
,comfirm
,preferTime
,date
) VALUES (NULL,{$fName}
,{$lName}
,{$eMail}
,{$telephone}
,{$outlet}
,{$comfirmation}
,{ $preferTime}
,{$day}
)「);
的幫助,是我沒有檢查變量不是空的,我也嘗試沒有``之間的每個{}
始終使用綁定變量。 – Flimzy
您需要添加引號。 – Aneri
你需要在字符串周圍添加引號...''{$ fname}',...'但是它看起來像你真的打開了自己的SQL注入 –