执行以下脚本的时候请 先备份数据库!文本存放的新闻正文字段不可用!
新闻正文字段作为主表的情况用以下语句:
update phome_ecms_news set titlepic =concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, ‘src=’, -1),’.gif’,1),'”‘,”),’.gif’) where newstext like ‘%.gif%’ and titlepic=”;
update phome_ecms_news set titlepic =concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, ‘src=’, -1),’.jpg’,1),'”‘,”),’.gif’) where newstext like ‘%.jpg%’ and titlepic=”;
update phome_ecms_news set titlepic =concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(newstext, ‘src=’, -1),’.png’,1),'”‘,”),’.png’) where newstext like ‘%.png%’ and titlepic=”;
新闻正文字段作为副表的情况用以下语句:
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, ‘src=’, -1),’.gif’,1),'”‘,”),’.gif’) where a.newstext like ‘%.gif%’ and b.titlepic=” and a.id=b.id;
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, ‘src=’, -1),’.jpg’,1),'”‘,”),’.jpg’) where a.newstext like ‘%.jpg%’ and b.titlepic=” and a.id=b.id;
update [!db.pre!]ecms_news_data_1 a, [!db.pre!]ecms_news b set b.titlepic=concat(replace(SUBSTRING_INDEX(SUBSTRING_INDEX(a.newstext, ‘src=’, -1),’.png’,1),'”‘,”),’.png’) where a.newstext like ‘%.png%’ and b.titlepic=” and a.id=b.id;
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载完但解压或打开不了?
- 找不到素材资源介绍文章里的示例图片?
- 晴天seo