Changeset 219 for trunk/database.php
- Timestamp:
- May 27, 2009, 1:17:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/database.php
r187 r219 4 4 // Date: 2009-02-16 5 5 6 6 7 class Database extends mysqli 7 8 { 8 9 var $Prefix = ''; 10 var $Functions = array('NOW()', 'CURDATE()', 'CURTIME()', 'UUID()'); 9 11 10 12 function query($Query) 11 13 { 12 global $Config;14 global $Config; 13 15 14 if($Config['Web']['ShowSQLQuery'] == true)15 echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>');16 $Result = parent::query($Query);16 if($Config['Web']['ShowSQLQuery'] == true) 17 echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>'); 18 $Result = parent::query($Query); 17 19 if(($this->error != '') and ($Config['Web']['ShowSQLError'] == true)) 18 20 echo('<div><strong>SQL Error: </strong>'.$this->error.'<br />'.$Query.'</div>'); … … 39 41 $Value = strtr($Value, '"', '\"'); 40 42 $Name .= ',`'.$Key.'`'; 41 if($Value == 'NOW()') $Values .= ",".$Value; 42 else if($Value == 'UUID()') $Values .= ",".$Value; 43 else $Values .= ",'".$Value."'"; 43 if(!in_array($Value, $this->Functions)) $Value = '"'.$Value.'"'; 44 $Values .= ','.$Value; 44 45 } 45 46 $Name = substr($Name, 1); … … 54 55 { 55 56 $Value = strtr($Value, '"', '\"'); 56 if($Value != 'NOW()') $Value = "'".$Value."'";57 if(!in_array($Value, $this->Functions)) $Value = '"'.$Value.'"'; 57 58 $Values .= ', '.$Key.'='.$Value; 58 59 } … … 68 69 { 69 70 $Value = strtr($Value, '"', '\"'); 71 if(!in_array($Value, $this->Functions)) $Value = '"'.$Value.'"'; 70 72 $Name .= ',`'.$Key.'`'; 71 if($Value == 'NOW()') $Values .= ','.$Value; 72 else $Values .= ',"'.$Value.'"'; 73 $Values .= ','.$Value; 73 74 } 74 75 $Name = substr($Name, 1);
Note:
See TracChangeset
for help on using the changeset viewer.