[問題] #1064 SQL錯誤 更改wp文章內圖網址
大家好
因為最近網站使用Cloudflare免費的SSL
所以網址改成https
但是以前的文章裡面圖片連結還是http
會導致圖片無法顯示
我就參考網路上教學
到phpMyAdmin的SQL來更新圖片連結
語法如下:
UPDATE wp_posts
SET post_content = ( Replace (post_content, 'src="http://', 'src="//') )
WHERE Instr(post_content, 'jpeg') > 0
OR Instr(post_content, 'jpg') > 0
OR Instr(post_content, 'gif') > 0
OR Instr(post_content, 'png') > 0;
但就會出現這個錯誤
#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
'SET post_content = ( Replace (post_content, 'src="http://', 'src="//') )
WHERE I' at line 2
MySQL版本 5.1.73
phpMyAdmin版本 4.3.8
希望有人能解決我的問題
感激不盡
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.173.33.52
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1458221706.A.A09.html
→
03/19 19:55, , 1F
03/19 19:55, 1F
是替換,把http://換成//
※ 編輯: Caput (180.217.212.176), 03/20/2016 00:43:03
推
03/23 16:51, , 2F
03/23 16:51, 2F
→
03/23 16:54, , 3F
03/23 16:54, 3F
後來爬文有人說直接用phpMyadmin的搜尋取代,就成功更改了!還是謝謝你~
※ 編輯: Caput (180.217.243.203), 03/30/2016 13:23:41
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章