複製代碼代碼如下:
class DB{ var 🎜>var $host_user = "root";
var $host_psw = "123";
var $db_name =「測試」;
var $link_id;
var $query_id;
var $numRow;
函數DB(){
$this->link_id = @mysql_connect($this->host_addr,$this->host_user,$this-mysql_connect($this->host_addr,$this->host_user,$this-sql_connect($this->host_addr,$this->host_user,$this->host_this-m-> > if($this->link_id){
@mysql_select_db($this->db_name,$this->link_id) 或 $this->halt("資料庫連線失敗!");
🎜> $this->halt("連線伺服器失敗!");
回傳false;
}
return $this->link_id;
$this->query_id = @mysql_query($sql,$this->link_id);
if($this->query_id){
$this->halt("SQL 錯誤::");
回傳false;
}
} query_id);
}
函數close(){
return @mysql_close($this->link_id);
}
}
函數暫停($msg); 🎜> echo "".$msg."";
}
}
?>
http://www.bkjia.com/PHPjc/316920.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/316920.html
TechArticle
複製程式碼如下: ?php classDB{ var$host_addr="localhost"; var$host_user=「root」; var$host_psw="123"; var$db_name="測試"; var$link_id; var$query_id; var$numRow; functionDB(...