Desbrina Bored

Joined: 11 Jun 2005 Posts: 3120 Location: Around Somewhere
|
Posted: Thu May 15, 2008 4:40 pm Post subject: need sql statement |
|
|
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 |
|