Front Office Football Central  

Go Back   Front Office Football Central > Main Forums > FOF9, FOF8, and TCY Discussion
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 02-28-2014, 03:42 PM   #1
Dutch
"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.
Dutch is offline   Reply With Quote
Old 02-28-2014, 03:51 PM   #2
Ben E Lou
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'!
Ben E Lou is offline   Reply With Quote
Old 02-28-2014, 03:54 PM   #3
Dutch
"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.
Dutch is offline   Reply With Quote
Old 02-28-2014, 04:37 PM   #4
aston217
College Prospect
 
Join Date: Sep 2010
I think this can be accomplished without a translate table in the DB.

Code:
...WHERE week = change_stage($current_stage_name, -1)...
Code:
function change_stage($current_stage_name, $n) { $lookup_stage_names = array( '0' => 'Pre_Staff_Draft', '1' => '...' //etc. ); $key = array_search($current_stage_name, $lookup_stage_names); if ($key == false) { //default value $key = $current_stage; } return $key; }
__________________
OSFL (join us!) CFL
Float likeabutterflysting likeabee.



Last edited by aston217 : 03-04-2014 at 12:18 AM. Reason: oops, i messed this up a little at first
aston217 is offline   Reply With Quote
Old 03-02-2014, 02:39 PM   #5
Dutch
"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.
Dutch is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 05:17 PM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.