Changeset 28 for lists/SystemList.php
- Timestamp:
- Dec 8, 2008, 11:06:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lists/SystemList.php
r26 r28 9 9 $Database->query('CREATE TABLE IF NOT EXISTS `'.$Parameters['TableName'].'` ( 10 10 `Id` int(11) NOT NULL auto_increment, 11 `ItemId` int(11) NOT NULL,12 `Author` int(11) NOT NULL,13 `ValidTimeFrom` datetime default NULL,14 `ValidTimeTo` datetime default NULL,15 `CreationTime` datetime default NULL,16 `DeletionTime` datetime default NULL,17 11 PRIMARY KEY (`Id`) 18 12 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;'); 19 $Database->query('ALTER TABLE `'.$Parameters['TableName'].'` ADD INDEX ( `ItemId` );');20 13 //echo($Database->LastQuery); 21 14 } … … 25 18 global $Database; 26 19 27 $DbResult = $Database->query('SELECT `TableName` FROM `'.$Parameters['ListTableName'].'` WHERE I temId='.$Parameters['ItemId'].' ORDER BY `Id` DESC LIMIT 1,1');20 $DbResult = $Database->query('SELECT `TableName` FROM `'.$Parameters['ListTableName'].'` WHERE Id='.$Parameters['Id']); 28 21 $DbRow = $DbResult->fetch_assoc(); 29 22 if($DbRow['TableName'] != $Parameters['TableName']) 30 23 $Database->query('RENAME TABLE `'.$DbRow['TableName'].'` TO `'.$Parameters['TableName'].'`'); 31 24 } 25 26 function ApplySQLToItems($SQL) 27 { 28 global $Database; 29 30 $DbResult = $Database->query('SELECT `TableName` FROM `SystemList`'); 31 while($DbRow = $DbResult->fetch_assoc()) 32 { 33 $Database->query(str_replace('`TableName`', '`'.$DbRow['TableName'].'`', $SQL)); 34 } 35 } 32 36 } 33 37
Note:
See TracChangeset
for help on using the changeset viewer.