一个MYSQL操作类
2015-01-24信息快讯网
<?php
class DB{
var $host_addr = "localhost";
var $host_user = "root";
var $host_psw = "123";
var $db_name = "test";
var $link_id;
var $query_id;
var $numRow;
function DB(){
$this->link_id = @mysql_connect($this->host_addr,$this->host_user,$this->host_psw);
if($this->link_id){
@mysql_select_db($this->db_name,$this->link_id) or $this->halt("数据库连接失败!");
}else{
$this->halt("连接服务器失败!");
return false;
}
return $this->link_id;
}
function query($sql){
$this->query_id = @mysql_query($sql,$this->link_id);
if($this->query_id){
return $this->query_id;
}else{
$this->halt("SQL Error::");
return false;
}
}
function numRow(){
return $this->numRow = @mysql_num_rows($this->query_id);
}
function close(){
return @mysql_close($this->link_id);
}
function halt($msg){
echo "<font color=\"#FF0000\">".$msg."</font>";
}
}
?>
php mssql 数据库分页SQL语句
Apache+php+mysql在windows下的安装与配置图解(最新版)
IIS php环境配置PHP5 MySQL5 ZendOptimizer phpmyadmin安装与配置
Linux下 php5 MySQL5 Apache2 phpMyAdmin ZendOptimizer安装与配置[图文]
使用Limit参数优化MySQL查询的方法
mysql limit查询优化分析
php环境配置 php5 mysql5 apache2 phpmyadmin安装与配置
一个好用的分页函数
MYSQL数据库初学者使用指南
php 之 没有mysql支持时的替代方案
html中select语句读取mysql表中内容
图片存储与浏览一例(Linux+Apache+PHP+MySQL)
PHP编程之高级技巧――利用Mysql函数