![]() |
|
|
#1 | ||
|
"Dutch"
Join Date: Oct 2000
Location: Tampa, FL
|
Web-Site Help: Viewing the Last Stage
I am having trouble in FOF7 doing a query where I can display last week's games.
In the Universe_Info.csv file, there is a reference to the current stage name, but not the last stage name. If anybody is willing to help me solve this, I would appreciate it. With dbupdater, I could simply write a query that would state, "WHERE week=(current_week - 1) because "current_week" was an integer. In the Universe_info.csv, the current week is written as "Ex. Season Week #2" (for example). I built a "stage_info" table and I can join that table to the universe_info table on "Ex. Season Week #2" and then go back one in the "stage_info.stage_id" column, but with no additional relationships that doesn't really do me any good. Is there a good way already built in that I need to look at? Last edited by Dutch : 02-28-2014 at 03:45 PM. |
||
|
|
|
|
|
#2 |
|
Morgado's Favorite Forum Fascist
Join Date: Oct 2000
Location: Greensboro, NC
|
Right now it's just a two-part process. Find the year by using select max(year) from fof7_game_information. Then I have a translate_weeks table (sounds similar to your stage_info one) that I join to from fof7_game_information to give me the week of the first gameid that matches that year. That gives me the week number and I can use that to connect to the performances from that week.
__________________
The media don't understand the kinds of problems and pressures 54 million come wit'! |
|
|
|
|
|
#3 |
|
"Dutch"
Join Date: Oct 2000
Location: Tampa, FL
|
I started to look at that the other day actually. The benefit of the game_id was that they are all static year to year (except 2003 for some reason), I just wasn't sure how I was going to use that.
But if you have it working that way, then I'll certainly follow suit. Thanks, Ben. |
|
|
|
|
|
#4 |
|
College Prospect
Join Date: Sep 2010
|
I think this can be accomplished without a translate table in the DB.
Code:
Code:
Last edited by aston217 : 03-04-2014 at 12:18 AM. Reason: oops, i messed this up a little at first |
|
|
|
|
|
#5 |
|
"Dutch"
Join Date: Oct 2000
Location: Tampa, FL
|
Damn, that's a great way to do it, I'm just not that skilled yet to be writing functions. At least, I certainly am not thinking 'function' at all, but that looks like something I need to develop. The benefit would that I wouldn't need to 'cheat' and add fields to the db, but that's what I ultimately did.
So now my 'stage_info' table shows the relationship to the stage before and after it for easy reference later on. So, my stage_info table looks like this stage_id game_id (primary key) stage_name last_stage_name next_stage_name Where the last three columns have a name that equals the universe_info.value_round_position's lone VARCHAR entry...which is the name of the current stage. Now I can relate the value_round_position to the next_game_stage value and I get last week's results. I feel like I went around the Earth to get from Tampa to Orlando, but fuck it, I'm there now. ![]() Thanks for the help, guys. Last edited by Dutch : 03-02-2014 at 02:40 PM. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|