Changeset 166 for trunk/trax/vendor/trax/active_record.php
- Timestamp:
- 03/09/06 17:22:35 (6 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/active_record.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/active_record.php
r165 r166 712 712 ($parameters[0]) ? $field = $parameters[0] : $field = "*"; 713 713 $sql = "SELECT $aggregrate_type($field) AS agg_result FROM $this->table_name "; 714 714 715 715 # Use any passed-in parameters 716 716 if (!is_null($parameters)) { … … 782 782 if($this->column_attribute_exists($column)) { 783 783 # Run the query to grab a specific columns value. 784 $result = self::$db->getOne("SELECT $column FROM $this->table_name WHERE id='$this->id'"); 784 $sql = "SELECT $column FROM $this->table_name WHERE id='$this->id'"; 785 $this->log_query($sql); 786 $result = self::$db->getOne($sql); 785 787 if($this->is_error($result)) { 786 788 $this->raise($result->getMessage()); … … 834 836 function query($sql) { 835 837 # Run the query 838 $this->log_query($sql); 836 839 $rs = self::$db->query($sql); 837 840 if ($this->is_error($rs)) { … … 2193 2196 function after_delete() {} 2194 2197 2198 function log_query($sql) { 2199 if(TRAX_MODE == "development" && $sql) { 2200 $GLOBALS['ACTIVE_RECORD_SQL_LOG'][] = $sql; 2201 } 2202 } 2203 2195 2204 /** 2196 2205 * @todo Document this API
