这个是程序中调用了mysql_error函数的,要屏蔽需要自己修改程序。
解决方案 »
- 请问这是什么情况啊FeedBack.html?Page=2
- php curl如何得到HTTP chunked response中chunked data size?
- 安装Wamp后,运行出错
- PHP 如何读取TXT里面的内容?
- WIN2003+PHP+IIS+ZEND配置,ZEND的完整讲述
- 如何用fopen()从网上读取html文件?(急)
- 有一阵子没来逛了!
- html和php的执行效率讨论
- 有谁研究过 Invision Power Board 吗?请教个问题.
- 关于一道div+css 网站首页布局的课后作业。。
- 新手求教: 我把 < 用htmlentities()转换成了 < 要是想反过来怎么办呢?
- 新手求教: php+com+access问题. 其它都正常,就是不能更新记录. 奇怪
Class MySQLDB
{
var $host;
var $user;
var $passwd;
var $database;
var $conn; //网页执行时间,add by breezexu 2008-11-14
var $starttime;//页面开始执行时间
var $stoptime;//页面结束执行时间
var $spendtime;//页面执行花费时间
var $querynum;//执行次数 //利用构造函数实现变量初始化
//同时连接数据库操作
function MySQLDB($host,$user,$password,$database)
{
$this->host = $host;
$this->user = $user;
$this->passwd = $password;
$this->database = $database;
$this->conn=mysql_connect($this->host, $this->user,$this->passwd) or
die("Could not connect to $this->host");
mysql_select_db($this->database,$this->conn) or
die("Could not switch to database $this->database");
//mysql_query("set names 'gb2312'");
$this->starttime = $this->getmicrotime();
} //该函数用来关闭数据库连接
function Close()
{
$this->stoptime = $this->getmicrotime();
MySQL_close($this->conn);
} //该函数实现数据库查询操作
function Query($queryStr)
{
$res =Mysql_query($queryStr, $this->conn) or
die("Could not query database");
$this->querynum = $this->querynum+1;
return $res;
} //该函数返回记录集
function getRows($res)
{
$rowno = 0;
$rowno = MySQL_num_rows($res);
if($rowno>0)
{
for($row=0;$row<$rowno;$row++ )
{
$rows[$row]=MySQL_fetch_array($res);
//本来为MySQL_fetch_row,但是不能以数组的方式来提取,只能用索引
//这样可以用索引和名称,更为方便
}
return $rows;
}
} //该函数取回数据库记录数
function getRowsNum($res)
{
$rowno = 0;
$rowno = mysql_num_rows($res);
return $rowno;
} //该函数返回数据库表字段数
function getFieldsNum($res)
{
$fieldno = 0;
$fieldno = mysql_num_fields($res);
return $fieldno;
} //该函数返回数据库表字段名称集
function getFields($res)
{
$fno = $this->getFieldsNum($res);
if($fno>0)
{
for($i=0;$i<$fno;$i++ )
{
$fs[$i]=MySQL_field_name($res,$i);//取第i个字段的名称
}
return $fs;
}
}
//网页执行时间函数,add by breezexu
function getmicrotime()//获取返回当前微秒数的浮点数
{
$aaa =explode(" ",microtime());
return ((float)$aaa[0] + (float)$aaa[1]);
} function start()//页面开始执行函数,返回开始页面执行的时间
{
$this->starttime=$this->getmicrotime();
} function display()//显示页面执行的时间
{
$this->stoptime=$this->getmicrotime();
$this->spendtime=$this->stoptime-$this->starttime;
return round($this->spendtime,10);
} function getquerynum()
{
return $this->querynum;
}
}