Example #1
0
 function &SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $arg3 = false, $secs2cache = 0)
 {
     if (!preg_match('/ORDER[ \\t\\r\\n]+BY/i', $sql)) {
         $sql .= ' ORDER BY 1';
     }
     return ADODBConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $arg3, $secs2cache);
 }
Example #2
0
 function &SelectLimit($sql, $nrows = -1, $offset = -1, $arg3 = false)
 {
     if ($offset <= 0) {
         // could also use " OPTIMIZE FOR $nrows ROWS "
         $sql .= " FETCH FIRST {$nrows} ROWS ONLY ";
         return $this->Execute($sql, false, $arg3);
     } else {
         return ADODBConnection::SelectLimit($sql, $nrows, $offset, $arg3);
     }
 }
Example #3
0
 function ErrorNo()
 {
     if ($this->haserrorfunctions) {
         $e = odbc_error($this->_connectionID);
         // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
         // so we check and patch
         if (strlen($e) <= 2) {
             return 0;
         }
         return $e;
     } else {
         return ADODBConnection::ErrorNo();
     }
 }
Example #4
0
 function check_username_no_sid($username, $escape = 1)
 {
     if ($escape) {
         $username = $this->SfStr->getSafeString($username, SAFE_STRING_DB);
     } else {
         $username = $this->SfStr->getSafeString($username, SAFE_STRING_ESC);
     }
     $query = "SELECT uid FROM {$this->CONF['db_tbl_prefix']}users WHERE username = {$username}";
     $rs = $this->db->Execute($query);
     if ($rs === FALSE) {
         $this->error('Error checking for existing username: '******'uid'];
     } else {
         return false;
     }
 }
Example #5
0
 /**
  * Delete Invoice
  *
  */
 function Delete()
 {
     $this->DB->Execute("DELETE FROM invoices WHERE id=?", array($this->ID));
 }