mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-01 05:37:37 +00:00
- added debug mode
This commit is contained in:
parent
fe01a6e29b
commit
07b1a9bc67
|
|
@ -27,6 +27,7 @@ require_once "adodb/adodb.inc.php";
|
||||||
* @version Release: @package_version@
|
* @version Release: @package_version@
|
||||||
*/
|
*/
|
||||||
class LetoDMS_Core_DatabaseAccess {
|
class LetoDMS_Core_DatabaseAccess {
|
||||||
|
var $_debug;
|
||||||
var $_driver;
|
var $_driver;
|
||||||
var $_hostname;
|
var $_hostname;
|
||||||
var $_database;
|
var $_database;
|
||||||
|
|
@ -84,6 +85,7 @@ class LetoDMS_Core_DatabaseAccess {
|
||||||
$this->_ttapproveid = false;
|
$this->_ttapproveid = false;
|
||||||
$this->_ttstatid = false;
|
$this->_ttstatid = false;
|
||||||
$this->_ttcontentid = false;
|
$this->_ttcontentid = false;
|
||||||
|
$this->_debug = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -144,7 +146,8 @@ class LetoDMS_Core_DatabaseAccess {
|
||||||
|
|
||||||
$res = $this->_conn->Execute($queryStr);
|
$res = $this->_conn->Execute($queryStr);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
print "<br>" . $this->getErrorMsg() . "<br>" . $queryStr . "</br>";
|
if($this->_debug)
|
||||||
|
echo "error: ".$queryStr."<br />";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$resArr = $res->GetArray();
|
$resArr = $res->GetArray();
|
||||||
|
|
@ -158,12 +161,16 @@ class LetoDMS_Core_DatabaseAccess {
|
||||||
* Call this function only with sql query which do not return data records.
|
* Call this function only with sql query which do not return data records.
|
||||||
*
|
*
|
||||||
* @param string $queryStr sql query
|
* @param string $queryStr sql query
|
||||||
|
* @param boolean $silent not used anymore. This was used when this method
|
||||||
|
* still issued an error message
|
||||||
* @return boolean true if query could be executed otherwise false
|
* @return boolean true if query could be executed otherwise false
|
||||||
*/
|
*/
|
||||||
function getResult($queryStr, $silent=false) { /* {{{ */
|
function getResult($queryStr, $silent=false) { /* {{{ */
|
||||||
$res = $this->_conn->Execute($queryStr);
|
$res = $this->_conn->Execute($queryStr);
|
||||||
if (!$res && !$silent)
|
if(!$res) {
|
||||||
print "<br>" . $this->getErrorMsg() . "<br>" . $queryStr . "</br>";
|
if($this->_debug)
|
||||||
|
echo "error: ".$queryStr."<br />";
|
||||||
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user