15:class DB_Sql {
var $Debug = 0;
var $sqoe = 1; // sqoe= show query on error var $Database = "";
var $User = "";
var $Password = ""; var $Link_ID = 0;
var $Record = array();
var $Row;
var $Parse;
var $Error = "";
var $Query_str = "";
/* public: constructor */
function DB_Sql($query = "") {
$this->query($query);
} function connect() {
if ( 0 == $this->Link_ID ) {
if($this->Debug) {
printf("<br>Connecting to $this->Database...<br>\n");
}
$this->Link_ID=OCIplogon("$this->User","$this->Password","$this->Database"); if (!$this->Link_ID) {
$this->halt("Link-ID == false " .
"($this->Link_ID), OCILogon failed");
}
if($this->Debug) {
printf("<br>Obtained the Link_ID: $this->Link_ID<br>\n");
}
}
}
function query($Query_String) { /* No empty queries, please, since PHP4 chokes on them. */
if ($Query_String == "")
/* The empty query string is passed on from the constructor,
* when calling the class without a query, e.g. in situations
* like these: '$db = new DB_Sql_Subclass;'
*/
return 0;
$this->Query_str = $Query_String;
if(!$this->Link_ID) // Lee Comment up command.
$this->connect();
$this->Parse=OCIParse($this->Link_ID,$Query_String);
if(!$this->Parse) {
$this->Error=OCIError($this->Parse);
}
69: else {
70: OCIExecute($this->Parse);
71: $this->Error=OCIError($this->Parse);
}
$this->Row=0; if($this->Debug) {
printf("Debug: query = %s<br>\n", $Query_String);
}
if ($this->Error["code"]!=1403 && $this->Error["code"]!=0 && $this->sqoe)
printf("");
//echo "<BR><FONT color=red><B>".$this->Error["message"]."<BR>Query :\"$Query_String\"</B></FONT>";
return $this->Parse;
}谢谢大侠先
var $Debug = 0;
var $sqoe = 1; // sqoe= show query on error var $Database = "";
var $User = "";
var $Password = ""; var $Link_ID = 0;
var $Record = array();
var $Row;
var $Parse;
var $Error = "";
var $Query_str = "";
/* public: constructor */
function DB_Sql($query = "") {
$this->query($query);
} function connect() {
if ( 0 == $this->Link_ID ) {
if($this->Debug) {
printf("<br>Connecting to $this->Database...<br>\n");
}
$this->Link_ID=OCIplogon("$this->User","$this->Password","$this->Database"); if (!$this->Link_ID) {
$this->halt("Link-ID == false " .
"($this->Link_ID), OCILogon failed");
}
if($this->Debug) {
printf("<br>Obtained the Link_ID: $this->Link_ID<br>\n");
}
}
}
function query($Query_String) { /* No empty queries, please, since PHP4 chokes on them. */
if ($Query_String == "")
/* The empty query string is passed on from the constructor,
* when calling the class without a query, e.g. in situations
* like these: '$db = new DB_Sql_Subclass;'
*/
return 0;
$this->Query_str = $Query_String;
if(!$this->Link_ID) // Lee Comment up command.
$this->connect();
$this->Parse=OCIParse($this->Link_ID,$Query_String);
if(!$this->Parse) {
$this->Error=OCIError($this->Parse);
}
69: else {
70: OCIExecute($this->Parse);
71: $this->Error=OCIError($this->Parse);
}
$this->Row=0; if($this->Debug) {
printf("Debug: query = %s<br>\n", $Query_String);
}
if ($this->Error["code"]!=1403 && $this->Error["code"]!=0 && $this->sqoe)
printf("");
//echo "<BR><FONT color=red><B>".$this->Error["message"]."<BR>Query :\"$Query_String\"</B></FONT>";
return $this->Parse;
}谢谢大侠先
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货