欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一個(gè)MYSQL操作類

 更新時(shí)間:2006年11月16日 00:00:00   作者:  
復(fù)制代碼 代碼如下:

<?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("數(shù)據(jù)庫(kù)連接失敗!");
  }else{
      $this->halt("連接服務(wù)器失??!");
   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>";
}

}
?>

相關(guān)文章

最新評(píng)論