I've got some simple updates inside my migration with strings that may contain special characters. For example:
$this->execute("UPDATE `setting` SET `classname` = 'org\foo\Bar' WHERE `id` = 1 ");
The problem with this for example, org\foo\Bar
when inserted into MySQL treats \
as escape characters. For each DB phinx
supports, I'm sure there are special characters that need to be handled in strings that when using PDO
directly you'd get around by using prepared statements and binding parameters.
Is there any native way in phinx
to escape strings or do I need to fall back on something like PDO::quote()
?
UPDATE `setting` SET `classname` = 'org\\foo\\Bar' WHERE `id` = 1
– Jacklight