织梦dedecms批量替换数据库数据(2)

    $rs8 = $dsql->ExecuteNoneQuery(" UPDATE `dede_mytag` SET `tagname` = REPLACE(`tagname`, '{$vv[0]}', '{$vv[1]}'), `normbody` = REPLACE(`normbody`, '{$vv[0]}', '{$vv[1]}'), `expbody` = REPLACE(`expbody`, '{$vv[0]}', '{$vv[1]}'); ");

    if(!$rs8) echo "替换{$vv[0]}失败<br />";

    else echo "替换{$vv[0]}成功<br />";

 

    //plus

    $rs9 = $dsql->ExecuteNoneQuery(" UPDATE `dede_plus` SET `plusname` = REPLACE(`plusname`, '{$vv[0]}', '{$vv[1]}'), `menustring` = REPLACE(`menustring`, '{$vv[0]}', '{$vv[1]}'), `mainurl` = REPLACE(`mainurl`, '{$vv[0]}', '{$vv[1]}'), `writer` = REPLACE(`writer`, '{$vv[0]}', '{$vv[1]}'); ");

    if(!$rs9) echo "替换{$vv[0]}失败<br />";

    else echo "替换{$vv[0]}成功<br />";

 

    //search_keywords

    $rs10 = $dsql->ExecuteNoneQuery(" UPDATE `dede_search_keywords` SET `keyword` = REPLACE(`keyword`, '{$vv[0]}', '{$vv[1]}'), `spwords` = REPLACE(`spwords`, '{$vv[0]}', '{$vv[1]}'); ");

    if(!$rs10) echo "替换{$vv[0]}失败<br />";

    else echo "替换{$vv[0]}成功<br />";

 

    //tagindex

    $rs11 = $dsql->ExecuteNoneQuery(" UPDATE `dede_tagindex` SET `tag` = REPLACE(`tag`, '{$vv[0]}', '{$vv[1]}'); ");

    if(!$rs11) echo "替换{$vv[0]}失败<br />";

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/4455c1bd131fcbe40f88dd785ee87081.html