Ejemplo n.º 1
0
 function _query($sql, $inputarr = false)
 {
     if ($inputarr) {
         if (is_array($sql)) {
             $stmtid = $sql[1];
         } else {
             $stmtid = @odbtp_prepare($sql, $this->_connectionID);
             if ($stmtid == false) {
                 $this->_errorMsg = $php_errormsg;
                 return false;
             }
         }
         $num_params = @odbtp_num_params($stmtid);
         for ($param = 1; $param <= $num_params; $param++) {
             @odbtp_input($stmtid, $param);
             @odbtp_set($stmtid, $param, $inputarr[$param - 1]);
         }
         if (!@odbtp_execute($stmtid)) {
             return false;
         }
     } else {
         if (is_array($sql)) {
             $stmtid = $sql[1];
             if (!@odbtp_execute($stmtid)) {
                 return false;
             }
         } else {
             $stmtid = @odbtp_query($sql, $this->_connectionID);
         }
     }
     $this->_lastAffectedRows = 0;
     if ($stmtid) {
         $this->_lastAffectedRows = @odbtp_affected_rows($stmtid);
     }
     return $stmtid;
 }
 function _query($sql, $inputarr = false)
 {
     global $php_errormsg;
     $php_errormsg = '';
     $this->_error = '';
     if ($inputarr) {
         if (is_array($sql)) {
             $stmtid = $sql[1];
         } else {
             $stmtid = odtp_prepare($sql, $this->_connectionID);
             if ($stmtid == false) {
                 $this->_errorMsg = $php_errormsg;
                 return false;
             }
         }
         if (!odbtp_execute($stmtid, $inputarr)) {
             return false;
         }
     } else {
         if (is_array($sql)) {
             $stmtid = $sql[1];
             if (!odbtp_execute($stmtid)) {
                 return false;
             }
         } else {
             $stmtid = odbtp_query($sql, $this->_connectionID);
         }
     }
     $this->_lastAffectedRows = 0;
     if ($stmtid) {
         $this->_lastAffectedRows = odbtp_affected_rows($stmtid);
     }
     $this->_errorMsg = $php_errormsg;
     return $stmtid;
     //return true;
 }