Skip to content
Advertisement

#1064 – You have an error in your SQL syntax. Error in my Update SQL statement

Can you please tell me what may be wrong in my SQL query?

SQL query:

UPDATE  'wp7b_5_usermeta' SET  'meta_key' = REPLACE(  'meta_key',  'wp_',  'wp7b_5_' ) WHERE  'meta_key' LIKE  'wp_%'

MySQL said: Documentation

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 ”wp7b_5_usermeta’ SET ‘meta_key’ = REPLACE (‘meta_key’, ‘wp_’, ‘wp7b_5_’) WHERE ‘ at line 1

Advertisement

Answer

you have to remove single quote for column and table name

 UPDATE  wp7b_5_usermeta
 SET  meta_key = REPLACE( meta_key,  'wp_',  'wp7b_5_' )
 WHERE  meta_key LIKE  'wp_%'
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement