Changeset 46 for trunk/Base/Database.php
- Timestamp:
- Jul 27, 2014, 9:05:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Base/Database.php
r42 r46 10 10 var $ShowSQLQuery = false; 11 11 var $ShowSQLError = false; 12 12 13 13 function query($Query) 14 { 14 { 15 15 if($this->ShowSQLQuery) 16 16 { 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>'); 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>'); 18 18 else echo($Query."\n"); 19 19 } … … 25 25 } 26 26 27 return($Result); 27 return($Result); 28 28 } 29 29 30 30 function select($Table, $What = '*', $Condition = 1) 31 31 { 32 return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 32 return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 33 33 } 34 34 35 35 function delete($Table, $Condition) 36 36 { 37 $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 37 $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 38 38 } 39 39 40 40 function insert($Table, $Data) 41 41 { … … 50 50 $Name = substr($Name, 1); 51 51 $Values = substr($Values, 1); 52 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 52 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 53 53 } 54 54 55 55 function update($Table, $Condition, $Data) 56 56 { … … 61 61 $Values .= ', `'.$Key.'`='.$Value; 62 62 } 63 $Values = substr($Values, 2); 63 $Values = substr($Values, 2); 64 64 $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')'); 65 65 } 66 66 67 67 function replace($Table, $Data) 68 68 { … … 79 79 //echo('REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES ('.$Values.')<br />'); 80 80 $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 81 //echo($this->error().'<br >');81 //echo($this->error().'<br/>'); 82 82 } 83 83 84 84 function charset($Charset) 85 85 {
Note:
See TracChangeset
for help on using the changeset viewer.