freeloader Posted July 5, 2009 Share Posted July 5, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/164858-mysql-join-tables/ Share on other sites More sharing options...
freeloader Posted July 5, 2009 Author Share Posted July 5, 2009 Update: second one solved as it wasn't necessary to use a join there. First one is still a mystery to me Quote Link to comment https://forums.phpfreaks.com/topic/164858-mysql-join-tables/#findComment-869347 Share on other sites More sharing options...
fenway Posted July 7, 2009 Share Posted July 7, 2009 What do you have so far? Listing "all" usually isn't te problem. Quote Link to comment https://forums.phpfreaks.com/topic/164858-mysql-join-tables/#findComment-870566 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.