精華 帝國PHP系統(tǒng)CMS系統(tǒng)SQL語句批量修改字段內(nèi)容的方法
<p>系統(tǒng) - 系統(tǒng)設(shè)置 - 數(shù)據(jù)備份與恢復(fù) - 執(zhí)行SQL語句里面執(zhí)行下面的語句。</p>
示例代碼如下:
update phome_ecms_news set titleurl=replace(titleurl,'http://www.moban5.cn','http://img.moban5.net');? //說明:替換鏈接地址
update phome_ecms_news set titlepic=replace(titlepic,'http://www.moban5.cn','http://img.moban5.net'); //說明:替換圖片地址
update phome_ecms_news set username=REPLACE(username,'admin','發(fā)布者') WHERE id BETWEEN 1 AND 100; 說明:指定批量修改ID=1-100;? //說明:替換發(fā)布用戶名
update phome_ecms_news set userid=REPLACE(userid,'1','55'),username=REPLACE(username,'admin','改變'),ismember=REPLACE(ismember,'0','1') WHERE id BETWEEN 1 AND 100; 一次批量修改三個字段id1到100的內(nèi)容。
以上就是帝國php系統(tǒng)批量修改字段內(nèi)容采用sql語句替換方法。