|Languages & Frameworks||
I originally created this site as a project to teach myself PHP and MySQL web development, and hosted it on my personal website. I announced it on the forums of the EarthBound fan site Starmen.Net; soon, they offered to let me integrate it into their site, where it resides today.
I used PHP for the server-side scripting and MySQL for the database.
EarthBound, as a role-playing game, has a reasonably complicated relationship between its entity types, with a number of many-to-many relationships:
Items are especially difficult, as they can fall into one of many different categories, with different attributes applicable for each category. For example, armor items would have values for how much they improve the player’s defense, while food items would have values for how much health they allow the player to recover.
To accommodate this structure, I set up the database with a table for each entity, and a junction table for each many-to-many relationship.
When displaying items, they’re listed individually or in a group with other items of the same category. The only exception where items of different categories are displayed together is in the alphabetical item list, which displays only name, an attribute common to all items. Thus, I set up the main items table with only attributes common to all items, including an enumerated category attribute. I also created a table for each item category containing that category’s specific attributes, and joined the appropriate table to the main item table for all individual item or item category lookups.