I am currently having an issue with a MySQL UPDATE statement I am working with. For some reason I am unable to escape the semicolons in the statement.
If I remove all the semi-colons from the statement it works fine, so I know it has something to do with escaping the semi-colons.
I've tried the standard method of escaping them by preceding them with a \
, however that does nothing.
I've also tried switching/swapping out all the single quotes for double quotes, and double quotes for single quotes, to reverse the ordering of them, which also does nothing.
Here is the statement I am trying to execute:
UPDATE email_campaign_template
SET content='<style>
/* General */
body {
font-family: "Open Sans", sans-serif;
color: #fdfcfc;
}
.container {
max-width: 660px;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
</style>
'
WHERE label='Property Flyer 01'
AND email_campaign_id = '10';
This generates the following error, which is referring to the first semicolon in the statement:
[Err] 1064 - 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 ''<style> /* General */ body { font-family: "Open Sans", sans-serif' at line 2
How can I successfully escape the semi-colons in order to be able to execute this RAW MySQL statement?