Changeset d7cb774 in github for program/include/rcube_db.inc
- Timestamp:
- Oct 25, 2005 11:04:17 AM (8 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- d13c369
- Parents:
- e0ed972
- File:
-
- 1 edited
-
program/include/rcube_db.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_db.inc
r53560c5 rd7cb774 102 102 } 103 103 104 // Query database (read operations) 105 106 function query($query, $offset=0, $numrows=0) 104 // Query database 105 106 function query() 107 { 108 $params = func_get_args(); 109 $query = array_shift($params); 110 111 return $this->_query($query, 0, 0, $params); 112 } 113 114 function limitquery() 115 { 116 $params = func_get_args(); 117 $query = array_shift($params); 118 $offset = array_shift($params); 119 $numrows = array_shift($params); 120 121 return $this->_query($query, $offset, $numrows, $params); 122 } 123 124 function _query($query, $offset, $numrows, $params) 107 125 { 108 126 // Read or write ? … … 119 137 if ($numrows || $offset) 120 138 { 121 $result = $this->db_handle->limitQuery($query,$offset,$numrows );139 $result = $this->db_handle->limitQuery($query,$offset,$numrows,$params); 122 140 } 123 141 else 124 $result = $this->db_handle->query($query );125 142 $result = $this->db_handle->query($query,$params); 143 126 144 if (DB::isError($result)) 145 { 127 146 raise_error(array('code' => 500, 128 147 'type' => 'db', … … 130 149 'file' => __FILE__, 131 150 'message' => $result->getMessage()), TRUE, FALSE); 132 151 return false; 152 } 153 133 154 return $this->_add_result($result, $query); 134 155 } … … 197 218 } 198 219 220 function quoteIdentifier ( $str ) 221 { 222 if (!$this->db_handle) 223 $this->db_connect('r'); 224 225 return $this->db_handle->quoteIdentifier($str); 226 } 227 228 function unixtimestamp($field) 229 { 230 switch($this->db_provider) 231 { 232 case 'pgsql': 233 return "EXTRACT (EPOCH FROM $field)"; 234 break; 235 default: 236 return "UNIX_TIMESTAMP($field)"; 237 } 238 } 239 199 240 function _add_result($res, $query) 200 241 {
Note: See TracChangeset
for help on using the changeset viewer.
