赞
踩
1:user表:
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
2:mysqltools.php (mysql工具类)
class MySqlTools{
private $host='127.0.0.1';
private $uname='root';
private $pwd='mysql';
private $dbname='test';
private $conn;
function __construct(){
$this->conn=mysql_connect($this->host,$this->uname,$this->pwd)
or die('mysql_connect error:'.mysql_error());
mysql_select_db($this->dbname)
or die('mysql_select_db error:'.mysql_error());
mysql_query("set names 'utf8'");
}
function exec_dql($sql){
$result&
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。