Changeset 366 for trunk/import/import_sql_mangos.php
- Timestamp:
- Mar 9, 2010, 1:01:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/import/import_sql_mangos.php
r357 r366 104 104 $Columns = substr($Columns, 1); 105 105 106 if($Group['Id'] == 8)$DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE Name="'.$Value['name'].'" AND (Language=0) ORDER BY VersionStartDESC LIMIT 1');107 else $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE entry='.$Value[$Group['MangosTableIndex']].' AND (Language=0) ORDER BY VersionStartDESC LIMIT 1');106 if($Group['Id'] == 8)$DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$Group['TablePrefix'].'` WHERE `Name`="'.$Value['name'].'" AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 107 else $DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$Group['TablePrefix'].'` WHERE `Entry`='.$Value[$Group['MangosTableIndex']].' AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 108 108 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 109 109 { … … 114 114 if ($DbRow2['VersionEnd'] <> $BuildNumber) 115 115 { 116 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']);116 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = "'.$BuildNumber.'" WHERE `ID`='.$DbRow2['ID']); 117 117 echo(', '); 118 118 } else echo('. '); 119 119 } else 120 120 { 121 $Columns = ' entry, language, VersionStart, VersionEnd';122 $Values = $DbRow2[' entry'].', 0, '.$BuildNumber.', '.$BuildNumber;121 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 122 $Values = $DbRow2['Entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 123 123 foreach($Group['Items'] as $GroupItem) 124 124 { … … 131 131 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 132 132 echo('# '); 133 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2[' entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT);133 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['Entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT); 134 134 } else echo('. '); 135 135 } … … 141 141 { 142 142 $Entry = 1; 143 $DbResult = $Database->SQLCommand('SELECT MAX(` entry`) FROM `'.$Group['TablePrefix'].'`');143 $DbResult = $Database->SQLCommand('SELECT MAX(`Entry`) FROM `'.$Group['TablePrefix'].'`'); 144 144 if(mysql_num_rows($DbResult) > 0) 145 145 { … … 151 151 } 152 152 153 $Columns = ' entry, language, VersionStart, VersionEnd';153 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 154 154 $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber; 155 155 foreach($Group['Items'] as $GroupItem) … … 168 168 } 169 169 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 170 $Database->SQLCommand('UPDATE ` group` SET LastVersion = "'.$BuildNumber.'", LastImport = NOW() WHERE Id='.$GroupId);170 $Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$BuildNumber.'", `LastImport` = NOW() WHERE `Id`='.$GroupId); 171 171 } 172 172
Note:
See TracChangeset
for help on using the changeset viewer.