Site hosted by Angelfire.com: Build your free website today!

Pokenet Database Setup

Welcome to the Pokenet Database Setup. This may take a few moments.

NOTE: MySQL 5.0 is recommended

"; mysql_connect($host, $username, $password) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); //Create the player table echo "Creating player table...
"; mysql_query("CREATE TABLE pn_members( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), username VARCHAR(12), password VARCHAR(255), dob VARCHAR(12), email VARCHAR(32), lastLoginTime VARCHAR(42), lastLoginServer VARCHAR(32), lastLoginIP VARCHAR(32), sprite INT, pokemons INT, money INT, skHerb INT, skCraft INT, skFish INT, skTrain INT, skCoord INT, skBreed INT, x INT, y INT, mapX INT, mapY INT, badges VARCHAR(50), healX INT, healY INT, healMapX INT, healMapY INT, isSurfing VARCHAR(5), muted VARCHAR(12), adminLevel INT )") or die(mysql_error()); /* Create bag table */ echo "Creating the bag table...
"; mysql_query("CREATE TABLE pn_bag( member INT NOT NULL, item INT NOT NULL, quantity INT NOT NULL )") or die(mysql_error()); /* Create the player pokemon table. Each player can have their party of 6 Pokemon and 9 boxes */ echo "Creating the player's pokemons tables...
"; mysql_query("CREATE TABLE pn_mypokes( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), member INT, party INT, box0 INT, box1 INT, box2 INT, box3 INT, box4 INT, box5 INT, box6 INT, box7 INT, box8 INT )") or die(mysql_error()); /* Create the box table. Each box stores 30 Pokemon (Id reference to pokemon table) */ echo "Creating the boxes table...
"; mysql_query("CREATE TABLE pn_box( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), member INT, pokemon0 INT NOT NULL DEFAULT '-1', pokemon1 INT NOT NULL DEFAULT '-1', pokemon2 INT NOT NULL DEFAULT '-1', pokemon3 INT NOT NULL DEFAULT '-1', pokemon4 INT NOT NULL DEFAULT '-1', pokemon5 INT NOT NULL DEFAULT '-1', pokemon6 INT NOT NULL DEFAULT '-1', pokemon7 INT NOT NULL DEFAULT '-1', pokemon8 INT NOT NULL DEFAULT '-1', pokemon9 INT NOT NULL DEFAULT '-1', pokemon10 INT NOT NULL DEFAULT '-1', pokemon11 INT NOT NULL DEFAULT '-1', pokemon12 INT NOT NULL DEFAULT '-1', pokemon13 INT NOT NULL DEFAULT '-1', pokemon14 INT NOT NULL DEFAULT '-1', pokemon15 INT NOT NULL DEFAULT '-1', pokemon16 INT NOT NULL DEFAULT '-1', pokemon17 INT NOT NULL DEFAULT '-1', pokemon18 INT NOT NULL DEFAULT '-1', pokemon19 INT NOT NULL DEFAULT '-1', pokemon20 INT NOT NULL DEFAULT '-1', pokemon21 INT NOT NULL DEFAULT '-1', pokemon22 INT NOT NULL DEFAULT '-1', pokemon23 INT NOT NULL DEFAULT '-1', pokemon24 INT NOT NULL DEFAULT '-1', pokemon25 INT NOT NULL DEFAULT '-1', pokemon26 INT NOT NULL DEFAULT '-1', pokemon27 INT NOT NULL DEFAULT '-1', pokemon28 INT NOT NULL DEFAULT '-1', pokemon29 INT NOT NULL DEFAULT '-1' )") or die(mysql_error()); /* Create the party table. A pokemon party stores 6 Pokemon (Id reference). */ echo "Creating the Pokemon party table...
"; mysql_query("CREATE TABLE pn_party( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), member INT, pokemon0 INT, pokemon1 INT, pokemon2 INT, pokemon3 INT, pokemon4 INT, pokemon5 INT )") or die(mysql_error()); /* Create the Pokemon table */ echo "Creating the Pokemon table...
"; mysql_query("CREATE TABLE pn_pokemon( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(24), speciesName VARCHAR(32), exp VARCHAR(32), baseExp INT, expType VARCHAR(16), isFainted VARCHAR(5), level INT, happiness INT, gender INT, nature VARCHAR(24), abilityName VARCHAR(24), itemName VARCHAR(28), isShiny VARCHAR(5), originalTrainerName VARCHAR(12), contestStats VARCHAR(255), move0 VARCHAR(32), move1 VARCHAR(32), move2 VARCHAR(32), move3 VARCHAR(32), hp INT, atk INT, def INT, speed INT, spATK INT, spDEF INT, evHP INT, evATK INT, evDEF INT, evSPD INT, evSPATK INT, evSPDEF INT, ivHP INT, ivATK INT, ivDEF INT, ivSPD INT, ivSPATK INT, ivSPDEF INT, pp0 INT, pp1 INT, pp2 INT, pp3 INT, maxpp0 INT, maxpp1 INT, maxpp2 INT, maxpp3 INT, ppUp0 INT, ppUp1 INT, ppUp2 INT, ppUp3 INT, date VARCHAR(28) )") or die(mysql_error()); /* Create the ban table. */ echo "Creating the ban table...
"; mysql_query("CREATE TABLE pn_bans( ip VARCHAR(48) )") or die(mysql_error()); echo "Setup complete"; ?>