1

I am trying to replace "?t" string to "'t" (apostrophe t)

I enter this command in phpMyAdmin

UPDATE "myTable"
SET "myColumn" = REPLACE ("myColumn", "\?t", "\'t")

as suggested in How can I use mySQL replace() to replace strings in multiple records?)

I get this error

#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 #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 UPDATE "myTable"
SET "myColumn" = REPLACE ("myColumn", "\?t", "\'t") at line 1

What is wrong with my command?

Thanks

Community
  • 1
  • 1
Wayne
  • 763
  • 4
  • 21
  • 43

1 Answers1

1

Don't quote table or column names. If you need to escape them use backticks

UPDATE `myTable`
SET `myColumn` = REPLACE (`myColumn`, '?t', '\'t')
juergen d
  • 201,996
  • 37
  • 293
  • 362