My PHP script is importing data from a XML file into mySQL. Why do I get a error message when I'm trying to import a text with ' (single quote) like this?
<Bildtext>Hans' fäbodar i Gräsbo</Bildtext>
The error message tells me that:
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'fäbodar i
Gräsbo', Lagring = '3', FotografID = '56', TekniskBildtyp = '1', Last ' at
line 1
This is a code fragment:
mysql_query("UPDATE helsingebilder_products SET bild = '$filnamn', Bildtext = '$Bildtext', Lagring = '$Lagring', FotografID = '$FotografID', TekniskBildtyp = '$TekniskBildtyp', Last = '$Last', ArtalNiva2ID = '$ArtalNiva2ID', LandskapID = '$LandskapID', KommunID = '$KommunID', SockenID = '$SockenID', ByOrtID = '$ByOrtID', GardPlatsID = '$GardPlatsID' WHERE BildID = '$BildID'") or die(mysql_error());