Hi all,
I am having a problem with my website.
I run a footy website and I am trying to simplify a procedure.
Basically each week managers can make bids for new players. The procedure is that they have to put one of their players in the pot and then bid a minimum and maximum fee for the new player.
I think my database design is flawed slightly as I use the Player ID's and do not always pass the name over.
Here is an example of what I am trying to achieve.
Manager 'A' is bidding for the following:
Player Out - Drogba
Player in - Berbatov
Minimum bid £250,000
Maximum bid £1,000,000
This would be sent to a table in the database as follows:
TID (Transfer ID) - Primary field and automated
DATE (Date placed) - 23/10/08
BIDMID (Managers ID) - 10
INFFLID (Player in ID) - 110
OUTFFLID (Player out ID) - 200
MINBID - £250,000
MAXBID - £1,000,000
SUCESS (y, n or p for pending which is default) - p
There are other fields that are irrelevant in this case, they are used for historical purposes.
So, What I am trying to do is extract the info from this table and use some of it to extract data from the Players table in order to display names rather than ID's for the players.
The Players table looks like this:
PID (Player ID which will match INFFLID or OUTFFLID)
PNAME (Players Name)
MID (Managers ID, this is used to list the current manager as only 1 manager can have a player in the league)
again lot's of other fields which are not relevant at this point.
So I want to display a table that would look like this (it should only display 'p' status bids for an individual manager.):
Player Out -- Player In - Min Bid ----- Max Bid ----- Edit - Delete
Drogba ------ Berbatov - £250,000 - £1,000,000 - Link - Link
The trouble I am having is that I can only display the Player out as I am trying to get the name of the player from the Managers ID and clearly the player in does not havea manager linked to him!
I know this may be confusing, it is to me! I could have set up the database better and may need to do so but it is too far into the season now to do this.
Currently I can get around this by using two data grids side by side and sorting on the Transfer ID which is unique, but I need to do it all in one go.
Does anyone have any suggestions? I can provide a lot more detail if anyone is clued up on SQL queries and think that they can help.
There must be a way to do what I am trying to do.
Again sorry if the above description is naff!!
Social Networking Bookmarks