View Single Post
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