PHP character garbled
MySql 控制台查询时出现乱码
Database&Table 的字符集 于Mysql控制台显示的字符集不一样
右键单击mysql控制台边框 单击属性 查看当前代码页的字符集模式是否于数据库的字符集模式一样
查看数据库字符集 show variables like '%char%';
主要看的有:character-set-client=gbk character-set-server=gbk character-set-result=gbk 是否一样
解决:设置数据库字符模式
alter database Database_name default character set gbk;
alter database Database_name default character set utf8 default collate utf8_geberal_ci;
collate utf8_geberal_ci : utf8 字符校对模式 gbk没找到校对,有请留言。
没效果请打开my.ini 修改 default-character-set=gbk character-set-server=gbk
创建的时候指定:
create database Database_name character set gbk;
页面乱码:在Dreamware 上找到页面属性 设置字符模式
如果有链接Mysql 应该保持统一
数据库+页面字符集+HTML head<meta charset=''>+Mysql于PHP链接字符(set names gbk)
在页面查询数据库获取的是乱码:Mysql ,页面字符集,mysql和PHP传输字符是否一样
设置apache的配置文件 httpd.conf 添加或修改apache 默认字符启动模式: AddDefaultchars gbk
直接设置传输字符 mysql> set names gbk
<?php $conn=mysql_connection("localhost","root","root");
mysql_query("set names gbk",$conn);
mysql_close();
?>
PHP character garbled的更多相关文章
- ERROR 1300 (HY000): Invalid utf8 character string: ''
在load csv 进mysql的时候,报这个错,苦恼了很长时间,网上搜索不到答案. mysql> load data infile '/home/hdh/8_sr/8_45.csv' ...
- [LeetCode] First Unique Character in a String 字符串第一个不同字符
Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex ...
- 387. First Unique Character in a String
Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex ...
- mysql character set exception
问题: 插入数据时,报了这样一个错误:“_mysql_exceptions.Warning: Incorrect string value: ‘\xE6\xB5\x81\xE8\xA1\x8C…’ f ...
- LeetCode 387. First Unique Character in a String
Problem: Given a string, find the first non-repeating character in it and return it's index. If it d ...
- BeautifulSoup Some characters could not be decoded, and were replaced with REPLACEMENT CHARACTER.
BeautifulSoup很赞的东西 最近出现一个问题:Python 3.3 soup=BeautifulSoup(urllib.request.urlopen(url_path),"htm ...
- java.lang.IllegalArgumentException: Illegal character in query at index 261
在BaseFragment中使用了LoadingPage,而LoadingPage的联网加载使用的是AsyncHttpClient.一直报java.lang.IllegalArgumentExcept ...
- ORA-06502:PL/SQL :numberic or value error: character string buffer too small
今天遇到一个错误提示:ORA-06502:PL/SQL :numberic or value error: character string buffer too small,一般对应的中文信息为:O ...
- Character类
Character类 用来判断大小写 方法: public static boolean isUpperCase(char ch):判断是否大写 public static boolean isLow ...
随机推荐
- C# 版本的冒泡排序,包括该死的控制台读取
期末出成绩了,绩点被数分拉下来太多,虽然我很想不在意,但是还是受不了 学了两天的JAVA了,无爱,还是喜欢C#,喜欢VS 一直学一下控制台读取来着,但是C#控制台读取真的很麻烦 using Syste ...
- Tomcat批处理文件小结
Tomcat批处理文件小结 一:嗯,如果你不了解Windows批处理文件,并且想了解一下,请先参看下面的链接资源(我也是因为想了解一下Windows批处理文件是用什么写的?怎么写的?才在园中找的,下面 ...
- redhat 安装 jdk1.7 问题
redhat 安装 jdk 后出现 dl failure on line 685Error: failed /usr/local/jdk1.6.0_10/jre/lib/i386/client/lib ...
- jQuery实用工具函数
1. 什么是工具函数 在jQuery中,工具函数是指直接依附于jQuery对象.针对jquery对象本身定义的说法,即全局性的函数,我们统称为工具函数,或Utilities函数.它们有一个明显的特征, ...
- Identify Memory Leaks in Visual CPP Applications —— VLD内存泄漏检测工具
原文地址:http://www.codeproject.com/Articles/1045847/Identify-Memory-Leaks-in-Visual-CPP-Applications 基于 ...
- hosts.allow和hosts.deny
/etc/hosts.allow和/etc/hosts.deny两个文件是控制远程访问设置的,通过他可以允许或者拒绝某个ip或者ip段的客户访问linux的某项服务. 比如SSH服务,我们通常只对管理 ...
- 【zz】matlab 均值方差
转自:http://blog.sina.com.cn/s/blog_4936c31d01011v8j.html 1. 均值 Matlab函数:mean >>X=[1,2,3] >&g ...
- SpringMVC 对比 struts2
一.SpringMVC的入口是Servlet,而struts2的入口是filter 二.SpringMVC会稍微比struts2 快些.SpringMVC是基于方法设计的,而struts2是基于类,每 ...
- 【JavaScript】之【Object】
见代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF- ...
- js中快速获取数组中的最大值最小值
var a=[1,2,3,5]; alert(Math.max.apply(null, a));//最大值 alert(Math.min.apply(null, a)); //最小值 多维数组如下 v ...