Original | Patch | ||
---|---|---|---|
3 | /** | 3 | /** |
4 | * Klasse zur Verbindung und Interatkion mit der Datenbank | 4 | * Klasse zur Verbindung und Interatkion mit der Datenbank |
5 | * @version svn:$Id$ | 5 | * @version svn:$Id$ |
6 | */ | ||
7 | |||
8 | /** | ||
9 | * SQL QUERIES LOG PATCH | ||
10 | * @link http://rexdev.de/dev_log/rex_sql-log.html | ||
6 | */ | 11 | */ |
7 | 12 | ||
8 | class rex_sql | 13 | class rex_sql | … | … |
23 | 28 | ||
24 | var $error; // Fehlertext | 29 | var $error; // Fehlertext |
25 | var $errno; // Fehlernummer | 30 | var $errno; // Fehlernummer |
26 | 31 | static $count = 0; | |
32 | static $log = array(); | ||
27 | /*private*/ function rex_sql($DBID = 1) | 33 | /*private*/ function rex_sql($DBID = 1) |
28 | { | 34 | { |
29 | global $REX; | 35 | global $REX; | … | … |
191 | /*public*/ function setQuery($qry) | 197 | /*public*/ function setQuery($qry) |
192 | { | 198 | { |
193 | // Alle Werte zurücksetzen | 199 | // Alle Werte zurücksetzen |
194 | $this->flush(); | 194 | $this->flush(); self::$count++; |
195 |
| 195 | |
196 | $qry = trim($qry); | 196 | $qry = trim($qry); self::$log[self::$count]['query'] = $qry; |
197 | $this->query = $qry; | 203 | $this->query = $qry; |
198 | $this->result = @ mysql_query($qry, $this->identifier); | 204 | $this->result = @ mysql_query($qry, $this->identifier); |
199 | 205 | … | … |
223 | break; | 229 | break; |
224 | } | 230 | } |
225 | } | 231 | } |
226 | } | 226 | } self::$log[self::$count]['rows'] = $this->rows; |
227 | } | 233 | } |
228 | else | 234 | else |
229 | { | 235 | { |
230 | $this->error = mysql_error($this->identifier); | 230 | $this->error = mysql_error($this->identifier); self::$log[self::$count]['error'] = $this->error; |
231 | $this->errno = mysql_errno($this->identifier); | 231 | $this->errno = mysql_errno($this->identifier); self::$log[self::$count]['errno'] = $this->errno; |
232 | } | 238 | } |
233 | 239 | ||
234 | if ($this->debugsql || $this->error != '') | 240 | if ($this->debugsql || $this->error != '') |
Powered by Chris Boulton's php-diff