看板 Web_Design 關於我們 聯絡資訊
大家好 因為最近網站使用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
kattte: 你要做的是把原本存圖片資料的欄位 加上httP:// ?03/19 19:55
是替換,把http://換成// ※ 編輯: Caput (180.217.212.176), 03/20/2016 00:43:03
BiNoKo: wp_posts要加單引號03/23 16:51
BiNoKo: 好像不是XD 請從第二行的單引號試試看?03/23 16:54
後來爬文有人說直接用phpMyadmin的搜尋取代,就成功更改了!還是謝謝你~ ※ 編輯: Caput (180.217.243.203), 03/30/2016 13:23:41