Changeset 50 for branches/old/database.php
- Timestamp:
- Feb 20, 2015, 8:54:42 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/old/database.php
r5 r50 7 7 { 8 8 var $Prefix = ''; 9 9 10 10 function select($Table, $What = '*', $Condition = 1) 11 11 { … … 18 18 $this->query("DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition); 19 19 } 20 20 21 21 function insert($Table, $Data) 22 22 { … … 27 27 $Value = strtr($Value, '"', '\"'); 28 28 $Name .= ','.$Key; 29 30 29 if($Value == 'NOW()') $Values .= ",".$Value; 30 else $Values .= ",'".$Value."'"; 31 31 } 32 32 $Name = substr($Name, 1); … … 35 35 //echo('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 36 36 } 37 37 38 38 function update($Table, $Condition, $Data) 39 39 { … … 41 41 foreach($Data as $Key => $Value) 42 42 { 43 43 $Value = strtr($Value, '"', '\"'); 44 44 if($Value != 'NOW()') $Value = "'".$Value."'"; 45 45 $Values .= ", ".$Key."=".$Value; … … 48 48 $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')'); 49 49 } 50 50 51 51 function replace($Table, $Data) 52 52 { … … 64 64 $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` (`'.$Name.'`) VALUES('.$values.')'); 65 65 } 66 66 67 67 function charset($Charset) 68 68 { … … 71 71 72 72 } 73 74 ?>
Note:
See TracChangeset
for help on using the changeset viewer.