Jump to content

Mysql join tables


freeloader

Recommended Posts

Hi guys,

 

I need some help with joining a few tables. My mysql knowledge is aweful, I've been reading up a lot on joining, but haven't quite been able to put the two queries I need together.

 

Intro: I have a database with tables DTB_Accounts (ID, Email, Password and a few more), DTB_Stats (ID, Offense, Defense and a few more), DTB_Units (ID, Soldier, Guard and a few more).

 

So all information on one account is spread over a few tables. Sometimes it is possible there's no entry for that specific account in database. For example when there's no stats yet on an account.

 

Now, I need two queries:

 

1) Purpose: listing all accounts in the database in a html table with columns ID, Email, Offense, Soldier, Guard.

 

2) Purpose getting all information on an account with a specific ID. (Get Email, Password, Offense, Defense, Soldier, Guard WHERE ID = specific ID).

 

All help is appreciated, thank you in advance :)

Link to comment
https://forums.phpfreaks.com/topic/164858-mysql-join-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.