php mysql乱码问题
mysql增加了连接数据库时的字符集选择,为了防止乱码,我们在每次进行数据库操作的时候都应该制定字符集,有两种方式:
假定数据库为utf-8的字符集,网页为gbk的字符集;
$link=mysql_connect($hostname,$username, $password) OR DIE (‘Unable to connect to database! Please try again later.’);
mysql_select_db($dbname);
第一种方式:mysql_query(“SET NAMES ‘gbk'”);
第二种方式:mysql_query(‘set character_set_results = gbk’);
欢迎转载,请注明出处:亲亲宝宝
遇到数据库问题和缓存问题我就头疼
[回复]
The personal loans seem to be essential for people, which are willing to start their own organization. In fact, that’s not hard to get a term loan.
[回复]
有用么?遇到过类似的
[回复]
数据库问题还需要专人来解决啊
[回复]