Changeset 42 for trunk/Base/Database.php
- Timestamp:
- Nov 24, 2009, 9:13:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Base/Database.php
r40 r42 4 4 // Date: 2009-02-16 5 5 6 7 6 class Database extends mysqli 8 7 { 9 8 var $Prefix = ''; 10 9 var $Functions = array('NOW()', 'CURDATE()', 'CURTIME()', 'UUID()'); 10 var $ShowSQLQuery = false; 11 var $ShowSQLError = false; 11 12 12 13 function query($Query) 13 { 14 global $Config; 15 16 if($Config['Web']['ShowSQLQuery'] == true) 14 { 15 if($this->ShowSQLQuery) 17 16 { 18 17 if(isset($_SERVER['REMOTE_ADDR'])) 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>'); … … 20 19 } 21 20 $Result = parent::query($Query); 22 if(($this->error != '') and ($ Config['Web']['ShowSQLError'] == true))21 if(($this->error != '') and ($this->ShowSQLError)) 23 22 { 24 23 if(isset($_SERVER['REMOTE_ADDR'])) echo('<div><strong>SQL Error: </strong>'.$this->error.'<br />'.$Query.'</div>'); … … 87 86 $this->query('SET NAMES "'.$Charset.'"'); 88 87 } 89 88 90 89 function TimeToMysqlDateTime($Time) 91 90 { 92 return(date('Y-m-d H:i:s', $Time)); 91 return(date('Y-m-d H:i:s', $Time)); 93 92 } 94 93 … … 96 95 { 97 96 $Parts = explode(' ', $Time); 98 $DateParts = explode('-', $Parts[0]); 97 $DateParts = explode('-', $Parts[0]); 99 98 $TimeParts = explode(':', $Parts[1]); 100 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 101 return($Result); 99 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 100 return($Result); 102 101 } 103 102 104 103 function MysqlDateToTime($Time) 105 104 { 106 return(MysqlDateTimeToTime($Time.' 0:0:0')); 107 } 105 return(MysqlDateTimeToTime($Time.' 0:0:0')); 106 } 108 107 } 109 108
Note:
See TracChangeset
for help on using the changeset viewer.