php封装mysql操作类
来源:互联网 发布:淘宝标题重复关键字 编辑:程序博客网 时间:2024/05/13 12:57
<?php class mysql{ private $host; private $name; private $pass; private $table; private $ut; function __construct($host,$name,$pass,$table,$ut){ $this->host=$host; $this->name=$name; $this->pass=$pass; $this->table=$table; $this->ut=$ut; $this->connect(); } function connect(){ $link=mysql_connect($this->host,$this->name,$this->pass) or die ($this->error()); mysql_select_db($this->table,$link) or die("没有数据库".$this->table); mysql_query("SET NAMES '$this->ut'"); }function query($sql, $type = '') { if(!($query = mysql_query($sql))) $this->show('Say:', $sql); return $query;} function show($message = '', $sql = '') {if(!$sql) echo $message;else echo $message.'<br>'.$sql;} function affected_rows() {return mysql_affected_rows();}function result($query, $row) {return mysql_result($query, $row);}function num_rows($query) {return @mysql_num_rows($query);}function num_fields($query) {return mysql_num_fields($query);}function free_result($query) {return mysql_free_result($query);}function insert_id() {return mysql_insert_id();}function fetch_row($query) {return mysql_fetch_row($query);}function version() {return mysql_get_server_info();}function close() {return mysql_close();} //============== function fn_insert($table,$name,$value){ $this->query("insert into $table ($name) value ($value)"); } } $db = new mysql('localhost','root','','data',"GBK");?>
0 0
- php封装mysql操作类
- php封装mysql操作类
- PHP操作MySql封装类
- php操作mysql(封装mysql类)
- PHP操作mysql类的封装
- PHP封装的一个单例模式Mysql操作类
- PHP(4)封装的mysql操作模块
- php封装xml操作类
- PHP封装数据库操作类
- PHP数据库操作类封装
- PHP封装FastDFS操作类
- PHP PDO(mysql) 封装类
- PHP 简单mysql封装类
- PHP封装Mysql工具类
- C# Mysql封装操作类
- PHP MySql的dql和dml操作的封装,成为固定的工具类
- php mysqli面向对象封装mysql数据库常用操作
- PHP+MYSQL操作类
- hdu2519 新生晚会
- 十款经典游戏的Java版本(开源)
- 多线程:生产者消费者实例
- poj1745 Divisibility
- Android ViewGroup事件分发机制
- php封装mysql操作类
- 改 c 程序笔记_1_fscanf格式字符串选取
- 我对未来计算机专业的计划
- cocos2dx-3.2之按钮变化
- PHP防注入安全代码
- PHP中的数组排序函数
- VS2010结合Github进行版本控制
- 使用滚动条
- PHP 防注入函数(格式化数据)