Changeset 30 for database_list.php
- Timestamp:
- Dec 16, 2008, 8:15:34 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
database_list.php
r28 r30 7 7 function AddItem($TableId, $Values) 8 8 { 9 $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE Id='.$TableId);9 $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId); 10 10 $DbRow = $DbResult->fetch_assoc(); 11 11 $TableName = $DbRow['TableName']; 12 12 13 $this->Database->insert( $TableName, $Values);13 $this->Database->insert(array('Table' => $TableName), $Values); 14 14 return($this->Database->insert_id); 15 15 } … … 17 17 function DeleteItem($TableId, $ItemId) 18 18 { 19 $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE Id='.$TableId);19 $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId); 20 20 $DbRow = $DbResult->fetch_assoc(); 21 21 $TableName = $DbRow['TableName']; 22 $this->Database->delete( $TableName, 'Id='.$ItemId, array('DeletionTime' => 'NOW()'));22 $this->Database->delete(array('Table' => $TableName, 'Condition' => 'Id='.$ItemId), array('DeletionTime' => 'NOW()')); 23 23 } 24 24 25 25 function EditItem($TableId, $Values, $ItemId) 26 26 { 27 $DbResult = $this->Database->query('SELECT TableName FROM SystemList WHERE Id='.$TableId);27 $DbResult = $this->Database->query('SELECT `TableName`, `Database` FROM `SystemList` WHERE `Id`='.$TableId); 28 28 $DbRow = $DbResult->fetch_assoc(); 29 29 $TableName = $DbRow['TableName']; 30 30 $this->DeleteItem($TableId, $ItemId); 31 31 $Values['Id'] = $ItemId; 32 $this->Database->replace( $TableName, $Values);32 $this->Database->replace(array('Table' => $TableName), $Values); 33 33 } 34 34 }
Note:
See TracChangeset
for help on using the changeset viewer.