Thanks in advance for all your guys' help.
Here's the deal. The first time through, this script works. However, when you refresh the screen, it DOES NOT. Since the session variable has been registered, it moves on to the "else" part of the script. Yet, I get an error message on the screen that says:
Notice: Undefined variable: game_is_over_on_this_date in C:\Program Files\Apache Group\Apache2\htdocs\mostwantedgametest\test.php on line 95
Note that Line 95 is the call to the variable on this line of code:
if($game_is_over_on_this_date <= $check_end_against_this)
Please help me figure out why the session variable is returning FALSE!
if(!session_is_registered('game_is_over_on_this_date'))
{
$is_game_over_query = "select game_end_date from game_data";
$is_game_over_result = mysql_query($is_game_over_query);
if(!$is_game_over_result)
{
return "Could not perform the game ending date query";
exit;
}
$is_game_over_row = mysql_fetch_row($is_game_over_result);
$game_is_over_on_this_date = $is_game_over_row[0];
session_register('game_is_over_on_this_date');
if(!session_is_registered('game_is_over_on_this_date'))
{
return "could not register the game ending variable";
}
$check_end_against_this = substr($full_date, 0, 8);
if($game_is_over_on_this_date <= $check_end_against_this)
{
return "OVER";
exit;
}
}
else
{
$check_end_against_this = substr($full_date, 0, 8);
if($game_is_over_on_this_date <= $check_end_against_this)
{
return "OVER";
exit;
}
}
Just as a side note: This script is being called inside of a function. I don't know if this makes any difference, but the session is still registering, but for some reason, I guess the session variable is losing its value or something....?