2016-03-12 31 views
-1

我有這樣的錯誤: 當我做到這一點更新: 錯誤:省略號非FERME @ 124 STR:提前'錯誤:省略號非FERME @ 124

update referent set genderReferent='',phoneReferent='',faxReferent='',adressReferent='38, boulevard de l'Ayrolles - B.P. 145',supportOrganization='',zipCode='',cityReferent='',countryReferent='' where oldReferentId=5077 

Erreur de syntaxe près de 'Ayrolles - B.P. 145',supportOrganization='',zipCode='',cityReferent='',countryRe' à la ligne 1

感謝

+0

可能的重複[如何防止SQL注入在PHP?](http://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) –

回答

1

您需要在''內添加額外的'adressReferent

update referent 
set genderReferent='', 
    phoneReferent='', 
    faxReferent='', 
    adressReferent='38, boulevard de l''Ayrolles - B.P. 145', 
    supportOrganization='', 
    zipCode='', 
    cityReferent='', 
    countryReferent='' 
where oldReferentId=5077 
+0

我得到動態我怎麼才能解決這個問題,在此先感謝 –

+0

@kurchisuiden **您應該添加PHP代碼到您的問題**無論如何,如果它是串聯的SQL字符串,你應該使用參數綁定和特殊字符將自動espaced。 – lad2025