正 文

MYSQL的操作类(已封装)


www.7dspace.com  更新日期:2005-11-3 6:57:54  七度空间


   function Initialize()
    {
      $this->nErr=0;
      $this->NewEdit=0;
      $this->nResult=-1;
      $this->nCols=0;
      $this->nRows=0;
      $this->nOffset=0;
      $this->EOF=true;
      $this->sName="";
      $this->sValue="#@!";
      $this->sEdit="#@!";
      unset($this->aFName);
      unset($this->aNew);
    }
    function MySqlDB($TableName="",$database="slt")  //构造函数
    {
      $this->Initialize();
      $this->sTName=$TableName;
      $this->linkid=mysql_connect($host,$user,$password);
      if(!$this->linkid)
      {
        $this->nErr=1;
        $this->sErr="MySqlDB:数据库连接出错,请启动服务!";
        return;
      }
      $this->dbid=mysql_select_db($database);
      if(!$this->dbid)
      {
        $this->nErr=1;
        $this->sErr="MySqlDB:选择的数据库".$database."不存在!";
        return;
      }
    }

    function IsEmpty($Value)
    {
            if(is_string($Value)&&empty($Value))
               return true;
            return false;
    }

    function Destroy()          //数据清除处理
    {
      mysql_query("commit");
      mysql_close();
    }

    function PrintErr()
    {
      if($this->nErr==1)
      {
        echo($this->sErr."<br><br>");
      }
      else
      {
        echo("没有错误<br><br>");
      }
    }

6页,页码:[1] [2] [3] [4] [5] [6] 

上一篇:使用XML-RPC来访问Web服务
下一篇:Windows系统自动保存密码再现
作者:熊毅(小熊)  来源:CSDN ( 责任编辑:7dspace )
收藏此页】【打印】【关闭
站 内 搜 索
 

热 点 导 读
特 别 推 荐