开发者

How to set default connection character set for php mysql

I have a small problem. I have russian characters in a database and I want to avoid setting character_set_results to utf8 all the time. Is there a way to hard set that ?

mysql_query("set character_set_results='utf8'"); 

I want to avoid this line and hard开发者_高级运维 set it.

Thank you


mysql_query("SET NAMES 'utf8'");


For czech language I use:

mysql_query("set names latin2 collate latin2_czech_cs")

Don't forget to set the proper collation too!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜