PHP Code:
$cmdHp=array();
$cmdHp[] = "CREATE TABLE IF NOT EXISTS `is_items` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`vnum` int(10) unsigned NOT NULL,
`kategorie_id` int(10) unsigned NOT NULL,
`bild` varchar(50) NOT NULL,
`beschreibung` varchar(200) NOT NULL,
`preis` int(10) unsigned NOT NULL,
`anzeigen` varchar(1) NOT NULL,
`attrtype0` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue0` smallint(6) NOT NULL DEFAULT '0',
`attrtype1` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue1` smallint(6) NOT NULL DEFAULT '0',
`attrtype2` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue2` smallint(6) NOT NULL DEFAULT '0',
`attrtype3` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue3` smallint(6) NOT NULL DEFAULT '0',
`attrtype4` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue4` smallint(6) NOT NULL DEFAULT '0',
`attrtype5` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue5` smallint(6) NOT NULL DEFAULT '0',
`attrtype6` tinyint(4) NOT NULL DEFAULT '0',
`attrvalue6` smallint(6) NOT NULL DEFAULT '0',
`socket0` int(10) unsigned NOT NULL DEFAULT '0',
`socket1` int(10) unsigned NOT NULL DEFAULT '0',
`socket2` int(10) unsigned NOT NULL DEFAULT '0',
`socket3` int(10) unsigned NOT NULL DEFAULT '0',
`socket4` int(10) unsigned NOT NULL DEFAULT '0',
`socket5` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
);";
$cmdHp[] = "CREATE TABLE IF NOT EXISTS `is_kategorien` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`titel` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
);";
$cmdHp[] = "CREATE TABLE IF NOT EXISTS `is_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`vnum` int(10) unsigned NOT NULL,
`preis` int(10) unsigned NOT NULL,
`zeitpunkt` datetime NOT NULL,
PRIMARY KEY (`id`)
);";
$cmdHp[] = "CREATE TABLE IF NOT EXISTS `psc_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`admin_id` int(11) DEFAULT NULL,
`card_type` varchar(20) NOT NULL,
`waehrung` varchar(10) NOT NULL,
`psc_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`psc_betrag` decimal(5,2) NOT NULL,
`psc_pass` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`status` int(1) NOT NULL,
`kommentar` varchar(200) NOT NULL,
`datum` datetime NOT NULL,
PRIMARY KEY (`id`)
);";
$cmdHp[] = "CREATE TABLE IF NOT EXISTS `server_settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`variable` varchar(20) NOT NULL UNIQUE,
`beschreibung` varchar(100) NOT NULL,
`typ` enum('CHA','BOO','INT','DEC') NOT NULL,
`value` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
);";
$cmdHp[] = "INSERT INTO `server_settings` (`variable`, `beschreibung`, `typ`, `value`) VALUES
('maxGoldRate', 'Faktor der max. Gold-Drop-Rate', 'DEC', '1');";
$cmdHp[] = "INSERT INTO `server_settings` (`variable`, `beschreibung`, `typ`, `value`) VALUES
('expRate', 'Faktor der EXP-Rate', 'DEC', '1');";
$cmdHp[] = "INSERT INTO `server_settings` (`variable`, `beschreibung`, `typ`, `value`) VALUES
('minGoldRate', 'Faktor der minimalen Gold-Drop-Rate', 'DEC', '1');";
$cmdHp[]="CREATE TABLE IF NOT EXISTS `ban_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`admin_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`zeitpunkt` datetime NOT NULL,
`grund` varchar(200) NOT NULL,
`typ` varchar(5) NOT NULL,
PRIMARY KEY (`id`)
);";
$cmdHp[]="CREATE TABLE `news` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`titel` varchar(200) NOT NULL,
`inhalt` text NOT NULL,
`datum` int(10) unsigned NOT NULL,
`hot` tinyint(1) NOT NULL,
`kategorie` int(10) unsigned NOT NULL,
`author` int(10) unsigned NOT NULL,
`anzeigen` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;";
foreach($cmdHp AS $blub) {
echo '<p style="font-size:11px;">'.$blub;
$aktQry = mysql_query($blub,$sqlHp);
if($aktQry)
{
echo '<br><span style="color: #080">erfolgreich ausgeführt</a>';
}
else
{
echo '<br><span style="color: #800">Nicht ausgeführt:<br>';
echo mysql_error();
echo'</a>';
}
echo'</p>';
}
}
function createGsTables() {
echo'<p><b>Gameserver-Datenbank</b></p>';
global $sqlServ;
$cmdGS=array();
$cmdGS[]="ALTER TABLE account.account
ADD `coins` int(11) NOT NULL DEFAULT '0';";
$cmdGS[]="ALTER TABLE account.account
ADD `web_admin` int(1) NOT NULL DEFAULT '0';";
$cmdGS[]="ALTER TABLE account.account
ADD `web_ip` varchar(15) NOT NULL;";
$cmdGS[]="ALTER TABLE account.account
ADD `web_aktiviert` varchar(32) NOT NULL;";
foreach($cmdGS AS $blub) {
echo '<p style="font-size:11px;">'.$blub;
$aktQry = mysql_query($blub,$sqlServ);
if($aktQry)
{
echo '<br><span style="color: #080">erfolgreich ausgeführt</a>';
}
else
{
echo '<br><span style="color: #800">Nicht ausgeführt:<br>';
echo mysql_error();
echo'</a>';
}
echo'</p>';
}