X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/8443f36d944b7b8adb30c6d1a35fb9afe6f05c32..43058315031aa0f6782c3b582c8a7927634aa932:/gameserv/php/install.php diff --git a/gameserv/php/install.php b/gameserv/php/install.php index 1f6a324..9f2e858 100644 --- a/gameserv/php/install.php +++ b/gameserv/php/install.php @@ -1,6 +1,19 @@ "; + +$query = "CREATE Table `$playertablename` (`name` text, `level` int NOT NULL default 1, `exp` bigint NOT NULL default 0, `gold` bigint NOT NULL default 0, `bank` bigint NOT NULL default 0, `hp` int NOT NULL default 0, `maxhp` int NOT NULL default 0, `strength` int NOT NULL default 0, `defense` int NOT NULL default 0, `forestfights` int NOT NULL default 0, `playerfights` int NOT NULL default 0, `lastlogin` text, `weaponID` bigint NOT NULL default 0, `armorID` bigint NOT NULL default 0, PRIMARY KEY (`name`(255)), KEY `weaponID` (`weaponID`), KEY `armorID` (`armorID`), CONSTRAINT `" . $playertablename . "_ibfk_1` FOREIGN KEY (`weaponID`) REFERENCES $itemtablename(`id`), CONSTRAINT `" . $playertablename . "_ibfk_2` FOREIGN KEY (`armorID`) REFERENCES $itemtablename(`id`)) ENGINE=InnoDB"; + +echo "\n $query \n"; +mysql_query($query) or die("Couldn't create table $playertablename: " . mysql_error()); + +echo "Player table created.
"; + +echo 'Click here to import the data into mysql'; ?> \ No newline at end of file