Lifelesspeople.com

 Forum FAQsForum FAQs  KnowledgebaseKnowledgebase  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need sql statement  Share

 
Lifelesspeople.com Forum Index -> Bargain Boutique
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Bored


Joined: 11 Jun 2005
Posts: 3120
Location: Around Somewhere

PostPosted: Thu May 15, 2008 4:40 pm    Post subject: need sql statement Reply with quote

I've tried this many times myself and i'm not getting anywhere, so i'm paying someone to do it for me.

Name your price in VSP

I have a select box in a form on my page, and i want to fill it with information from the database.

I have 2 tables in the database
http://midnighttempest.com/tables.txt

I want to see what decks in the cards table a user has all the cards for. So for each distinct deck in the cards table, count the number of rows to it, then compare it to the number of rows in the user_inventory table.

This is the sql code i was using before i changed the structure of the user_inventory table, getting rid of the columns, url,alttext,deck,worth,amount

http://midnighttempest.com/sql.txt

i need the the existing sql code edited so that it works with the new tables

Its an online trading card game, so the cards are what a user collects

The cards table contains the information for each card
The user_inventory table contains the cards that the user currently has

Each card is part of a deck, with a certain amount of cards per deck

To master a deck a user must have all the cards. So if there's 20 cards in a deck, and the user has all 20 (allowed duplicates as long as they have each each, ie 1-20) they can master a deck
If the user has 20 cards, but only 19 different ones (1-19 and 2 of 19) then they can't master the deck

Hope that explains it better
_________________
Midnight Tempest - A Sailor Moon TCG
Calona - an adoptables site
Top Tycoons - Coming soon
My Stories
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Bargain Boutique All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com