有时候会出现这样的情况,几个表 联合查询的时候,他们的字符编码不一样,就得不到我们想要的结果,通常我们手动去改表的options属性,保证这几个表的字符编码一致。但是还会有另外的问题存在,就是数据库里面已经有值了,你虽然改了表的字符编码,但是以前存进去的数据字符编码还没有改过来,所以最好的办法就是用sql语句:

alter table  privilege(1) convert to character set utf8 collate utf8_general_ci(2);

(1)表示要改的表的字符编码 (2)表示要改成什么样的字符编码

—-2009/11/20

Tags:

Related posts

Tags: .
Home

No Comments Now!

Be the first to comment on this entry.

Leave a comment

Name(required)
Mail (required),(will not be published)
Website(recommended)

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://hanghang.name),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.