Changeset 389 for database.php
- Timestamp:
- Oct 8, 2008, 12:42:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
database.php
r174 r389 1 <? 1 <?php 2 2 3 3 // Extended database class … … 7 7 { 8 8 var $Prefix = ''; 9 9 10 10 function select($Table, $What = '*', $Condition = 1) 11 11 { 12 12 $Query = "SELECT ".$What." FROM `".$this->Prefix.$Table."` WHERE ".$Condition; 13 return($this->query($Query)); 13 return($this->query($Query)); 14 14 } 15 15 16 16 function delete($Table, $Condition) 17 17 { 18 $this->query("DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition); 18 $this->query("DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition); 19 19 } 20 20 21 21 function insert($Table, $Data) 22 22 { … … 32 32 $Name = substr($Name, 1); 33 33 $Values = substr($Values, 1); 34 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 34 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 35 35 } 36 36 37 37 function update($Table, $Condition, $Data) 38 38 { … … 44 44 $Values .= ", ".$Key."=".$Value; 45 45 } 46 $Values = substr($Values, 2); 46 $Values = substr($Values, 2); 47 47 $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')'); 48 } 49 48 } 50 49 function replace($Table, $Data) 51 50 { … … 63 62 $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` (`'.$Name.'`) VALUES('.$values.')'); 64 63 } 65 64 66 65 function charset($Charset) 67 66 {
Note:
See TracChangeset
for help on using the changeset viewer.