Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading return value

Status
Not open for further replies.

Chomauk

Programmer
Jun 8, 2001
130
In my recordset I'm returning a value called GameDay which is equal to either 1, 2, 3, 4 or 5. When looping through the recordset, depending on the value of GameDay, I want to display a certain day when it changes. However, it appears when I'm reading the value it does not work.
I tried settype and I tried reading the case values inside single quotes and I tried comparing GameDay with $GameDay in the if statement. What am I doing wrong? Thanks
Code:
switch($ReturnRow1["GameDay"):
  case 1:
    $gameDay = "Thursday";
  case 2:
    $gameDay = "Friday";
  case 3;
    $gameDay = "Saturday";
  case 4:
     $gameDay = "Sunday";
  case 5:
    $gameDay = "Monday";
  default:
    $gameDay = "Does not work";
endswitch;

if($gameDay != $previousDay); {
echo $gameDay;
$previousDay = $gameDay;
}


"Failure is the tuition you pay for success."
~ Walter Brunell ~
 
You're right! Sorry, I'll try and move it to php.

"Failure is the tuition you pay for success."
~ Walter Brunell ~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top