Changeset 3 for database.php
- Timestamp:
- Oct 13, 2007, 5:41:26 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
database.php
r1 r3 10 10 function select($Table, $What = '*', $Condition = 1) 11 11 { 12 return($this->query("SELECT ".$What." FROM ".$this->Prefix.$Table." WHERE ".$Condition)); 12 $Query = "SELECT ".$What." FROM `".$this->Prefix.$Table."` WHERE ".$Condition; 13 return($this->query($Query)); 13 14 } 14 15 15 16 function delete($Table, $Condition) 16 17 { 17 $this->query("DELETE FROM ".$this->Prefix.$Table."WHERE ".$Condition);18 $this->query("DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition); 18 19 } 19 20 … … 31 32 $Name = substr($Name, 1); 32 33 $Values = substr($Values, 1); 33 $this->query('INSERT INTO '.$this->Prefix.$Table-' ('.$Name.') VALUES('.$Values.')'); 34 $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 35 //echo('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 34 36 } 35 37 36 38 function update($Table, $Condition, $Data) 37 39 { 40 $Values = ''; 38 41 foreach($Data as $Key => $Value) 39 42 { … … 43 46 } 44 47 $Values = substr($Values, 2); 45 $this->query('UPDATE '.$this->Prefix.$Table.'SET '.$Values.' WHERE ('.$Condition.')');48 $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')'); 46 49 } 47 50 … … 59 62 $Name = substr($Name, 1); 60 63 $Values = substr($Values, 1); 61 $this->query('REPLACE INTO '.$this->Prefix.$Table.' ('.$Name.') VALUES('.$values.')');64 $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` (`'.$Name.'`) VALUES('.$values.')'); 62 65 } 63 66
Note:
See TracChangeset
for help on using the changeset viewer.