Jump to content
xisto Community

Scene

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hello guys, I'm making a PHP/MySQL site for a friend of mine who plays an online game where you can create towns, add buildings to them and upgrade them to a newer level. I've offered to make him a small site where he can input his data into a database and keep track of his towns, buildings and levels. I'll show you my database design and then explain what i want to do. Table: towns field 1: TownID (primary key, auto-increment) field 2: TownName field 3: TownType field 4: Town Description Table: buildings field 1: BuildingID (primary key, auto-increment) field 2: BuildingName field 3: BuildingType field 4: BuildingDescription Table: evolution field 1: EvolutionID (primary-key, auto-increment) field 2: TownID (foreign key,) / link to TownID in towns table field 3: BuildingID (foreign key) / link to BuildingID in buildings table field 4: Level / current building level In essence i want to use the evolution table to combine the previous tables, and generate an overview showing the buildings each town has and on what level these buildings are. My current SQL query is: $sqlOverview = mysql_query("SELECT * FROM buildings b JOIN evolution e ON b.BuildingID = e.BuildingIDJOIN towns t ON e.TownID = t.TownID"); Which gives me the following output: As you can see it prints every building in a separate HTML table, what i'd like is that each building that is linked to a town to be shown in the same table. My guess is my SQL query is causing this but i can't figure out how i can resolve this.. Any help would be appreciated, Kind regards, Scene PS. english is not my first language, if i dont make sense or additional explaining is required please let me know.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.