我有一個列在表wp_postmeta caled meta_value在MySQL的phpMyAdmin與嵌入的代碼替換YouTube網址
列目前持有YouTube網址,但我們正在試圖改變URL的使用嵌入代碼。例如:
電流值
http://www.youtube.com/watch?v=ZHIhsLhQ-q8
新值應爲
<iframe width="640" height="360" src="//www.youtube.com/embed/ZHIhsLhQ-q8" frameborder="0" allowfullscreen></iframe>
這是我的查詢,但它似乎並沒有爲我工作:
UPDATE wp_postmeta SET `meta_value`=REPLACE(`meta_value`, 'http://www.youtube.com/watch?v=', '<iframe width="640" height="360" src="//www.youtube.com/embed/'),'"frameborder="0" allowfullscreen></iframe>');
錯誤:
#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 ''"frameborder="0" allowfullscreen></iframe>')' at line 1