function query_id() {
return $this->Query_ID;
}
/* 连接处理 */
function connect($Database = "", $Host = "", $User = "", $Password = "") {
/* Handle defaults */
if ("" == $Database)
$Database = $this->Database;
if ("" == $Host)
$Host = $this->Host;
if ("" == $User)
$User = $this->User;
if ("" == $Password)
$Password = $this->Password;
/* 建立连接,选择数据库 */
if ( 0 == $this->Link_ID ) {
$this->Link_ID=mysql_pconnect($Host, $User, $Password);
if (!$this->Link_ID) {
$this->halt("pconnect($Host, $User, \$Password) failed.");
return 0;
}
if (!@mysql_select_db($Database,$this->Link_ID)) {
$this->halt("cannot use database ".$this->Database);
return 0;
}
}
return $this->Link_ID;
}
/* 丢弃查询结果,释放占用的内存 */
function free() {
@mysql_free_result($this->Query_ID);
$this->Query_ID = 0;
}
/* 完成一个查询操作 */
function query($Query_String) {
/* No empty queries, please, since PHP4 chokes on them. */
if ($Query_String == "")
/* The empty query string is passed on from the constructor,
* when calling the class without a query, e.g. in situations
* like these: '$db = new DB_Sql_Subclass;'
*/
return 0;
if (!$this->connect()) {
return 0; /* we already complained in connect() about that. */
};
# New query, discard previous result.
if ($this->Query_ID) {
$this->free();
}保留地址 http://www.qqread.com/php/c222209101.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- 使用PHP 5.2 中新的内存管理器 (0次浏览)
- 实例:PHP判断用户是否正确登录转到欢迎界面 (0次浏览)
- 入门:学习掌握PHP的编程语句 (0次浏览)
- 关于PHP的前途 (0次浏览)
- 分析PHP应用程序以查找、诊断和加速运行缓慢的 (0次浏览)
- 动态语言崛起 Delphi For PHP横空出世 (0次浏览)
- Classes and Objects in PHP5 (0次浏览)
- apache 2.2.2 + PHP5.1.4 不能运行的解决办法 (0次浏览)
- Zeus+php+Zend Optimizer安装指南 (0次浏览)
- Windows下的PHP5.0安装配置详解 (0次浏览)



