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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.