一个MYsql类
<?php
class mysql {
/*+++++++++++++++数据库访问类++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
//=================================================
//连接数据
private $Host = "localhost"; //服务器地址
private $Database = "sansu"; //数据库名称
private $User = "root"; //用户名
private $Password = "czq339403229"; //用户密码
private $Char_Set = "utf8"; //设置数据库字符集
//结果数据
public $Link_ID = 0; //数据库连接
public $Query_ID = 0; //查询结果
public $Row_Result = array(); //结果节组成的数组
public $Field_Result = array(); //结果集字段组成的数组
// public $Affected_Rows=null; //影响的行数
// public $Rows = null; //结果集行数
// public $Fields = null; //结果集字段数
// public $Row_Position = null; //记录指针位置索引
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// _______________________________________________________________
/*
+++++++++++构造函数++++++++++++++++
+++++++++++++++
相关文档:
<!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;
mso-font-alt:"Courier New";
mso-font-charset:0;
mso-generic-font-family:modern;
mso-font-format:other;
mso-font-pitch:fixed;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{f ......
安装 MySQL,可以在终端提示符后运行下列命令:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// 安装php5-mysql 是将php和mysql连接起来
一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务器是否正在运行:
s ......
看到不少用户反映转换完以后是乱码的情况,出现这种现象的主要原因是这类用户使用的都是mysql4.1以上的版本.下面作一个说明,希望出现这个问题的朋友都能耐心的把这个文档看完!!!
MySQL 4.1开始,对多语言的支持有了很大变化 (这导致了问题的出现)。尽管大部分的地方 (包括个人使用和主机提供商),MySQL 3、4.0 仍然占主导地 ......
问题是这样的:
一张test的表,字符集采用的latin1。
select to_id from test where to_id='cn象_王';
+---------------+
| to_id |
+---------------+
| cn陶_陶 |
| cn象_王 |
+---------------+
2 rows in set (0.00 sec)
取cn象_王的数据,居然把cn陶_陶的数据也取回来了。
这显然是不允许的。
......