OpenCart - 中文论坛

标题: OpenCart用户注册省份中文修改操作方法 [打印本页]

作者: wenfu76    时间: 2011-4-4 16:25
标题: OpenCart用户注册省份中文修改操作方法
本帖最后由 wenfu76 于 2011-4-4 16:30 编辑

特别注意:请在执行命令前先备份数据库,以免带来麻烦,谢谢!

a、登录mysql数据库并且设置字符集:
mysql -u root -p  //进入数据库命令行方式
//开始设置字符集,这是必须的否则会出现乱码
set CHARSET utf8;
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;
b、修改国家和省份:
UPDATE `country` SET `name` = '中国' WHERE `name` = 'China';
UPDATE `zone` SET `name`= '安徽' WHERE `country_id` = '44' and `name`='Anhui';
UPDATE `zone` SET `name`= '北京' WHERE `country_id` = '44' and `name`='Beijing';
UPDATE `zone` SET `name`= '重庆' WHERE `country_id` = '44' and `name`='Chongqing';
UPDATE `zone` SET `name`= '福建' WHERE `country_id` = '44' and `name`='Fujian';
UPDATE `zone` SET `name`= '甘肃' WHERE `country_id` = '44' and `name`='Gansu';
UPDATE `zone` SET `name`= '广东' WHERE `country_id` = '44' and `name`='Guangdong';
UPDATE `zone` SET `name`= '广西' WHERE `country_id` = '44' and `name`='Guangxi';
UPDATE `zone` SET `name`= '贵州' WHERE `country_id` = '44' and `name`='Guizhou';
UPDATE `zone` SET `name`= '海南' WHERE `country_id` = '44' and `name`='Hainan';
UPDATE `zone` SET `name`= '河北' WHERE `country_id` = '44' and `name`='Hebei';
UPDATE `zone` SET `name`= '黑龙江' WHERE `country_id` = '44' and `name`='Heilongjiang';
UPDATE `zone` SET `name`= '河南' WHERE `country_id` = '44' and `name`='Henan';
UPDATE `zone` SET `name`= '香港' WHERE `country_id` = '44' and `name`='Hong Kong';
UPDATE `zone` SET `name`= '湖北' WHERE `country_id` = '44' and `name`='Hubei';
UPDATE `zone` SET `name`= '湖南' WHERE `country_id` = '44' and `name`='Hunan';
UPDATE `zone` SET `name`= '内蒙古' WHERE `country_id` = '44' and `name`='Inner Mongolia';
UPDATE `zone` SET `name`= '江苏' WHERE `country_id` = '44' and `name`='Jiangsu';
UPDATE `zone` SET `name`= '江西' WHERE `country_id` = '44' and `name`='Jiangxi';
UPDATE `zone` SET `name`= '吉林' WHERE `country_id` = '44' and `name`='Jilin';
UPDATE `zone` SET `name`= '辽宁' WHERE `country_id` = '44' and `name`='Liaoning';
UPDATE `zone` SET `name`= '澳门' WHERE `country_id` = '44' and `name`='Macau';
UPDATE `zone` SET `name`= '宁夏' WHERE `country_id` = '44' and `name`='Ningxia';
UPDATE `zone` SET `name`= '陕西' WHERE `country_id` = '44' and `name`='Shaanxi';
UPDATE `zone` SET `name`= '山东' WHERE `country_id` = '44' and `name`='Shandong';
UPDATE `zone` SET `name`= '上海' WHERE `country_id` = '44' and `name`='Shanghai';
UPDATE `zone` SET `name`= '山西' WHERE `country_id` = '44' and `name`='Shanxi';
UPDATE `zone` SET `name`= '四川' WHERE `country_id` = '44' and `name`='Sichuan';
UPDATE `zone` SET `name`= '天津' WHERE `country_id` = '44' and `name`='Tianjin';
UPDATE `zone` SET `name`= '新疆' WHERE `country_id` = '44' and `name`='Xinjiang';
UPDATE `zone` SET `name`= '云南' WHERE `country_id` = '44' and `name`='Yunnan';
UPDATE `zone` SET `name`= '浙江' WHERE `country_id` = '44' and `name`='Zhejiang';
C、验证操作结果:
select * from `country` where `name` = '中国';
select * from  `zone`  WHERE `country_id` = '44';

另外注意,不知道为什么执行完后前台还是拼音,要等很久才会显示中文,可能是Cookie的原因吧。







欢迎光临 OpenCart - 中文论坛 (https://bbs.opencart.cn/) Powered by Discuz! X3.2