|
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=sql/Index.html'>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() //数据清除处理 { sql/Index.html'>mysql_query("commit"); sql/Index.html'>mysql_close(); }
function PrintErr() { if($this->nErr==1) { echo($this->sErr."
"); } else { echo("没有错误
"); } }
function Execute($SQL) //直接执行SQL语句 { if(empty($SQL)) { $this->nErr=1; $this->sErr="Execute:执行语句不能为空!"; return false; } $this->sSQL=$SQL; if(!sql/Index.html'>mysql_query($SQL)) { $this->nErr=1; $this->sErr="Execute:SQL语句:".$SQL." MySql错误:".sql/Index.html'>mysql_error(); return false; } return true; }
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页
|