时时商务社区

标题: 一个MYSQL操作类 [打印本页]

作者: 网络通达    时间: 2018-2-14 09:40

            [U]复制代码[/U] 代码如下:
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 "
[color=]".$msg."
";
}
}
?>
            
            
您可能感兴趣的文章:
  • 从一个不错的留言本弄的mysql数据库操作类
  • php的access操作类
  • ezSQL PHP数据库操作类库
  • php下mysql数据库操作类(改自discuz)
            




    欢迎光临 时时商务社区 (http://bbs.4435.cn/) Powered by Discuz! X3.2