Jump to content

[SOLVED] design question


bschultz

Recommended Posts

I'm a radio announcer that does play-by-play for hockey games.  I'd like to create an online scoresheet so that I type in the jersey number of the player that scored and what time is on the scoreboard, and the php and database will print the players name and what time the goal was scored (if there's 8:00 on the clock when a goal is scored, the goal was scored at 12:00 - - - 20:00-8:00=12:00).

 

I have this working using html forms to insert into a database, but I currently have the players in a dropbox to insert the name and not the jersey number...I also have a drop box with the math of the time.  The problem is that the page size is 210K...and I'm on dial up at some of these hockey arenas. 

 

Here's my question.  I'd like to have php convert the numbers to names.  Would it be easier or better to do this PRIOR to inserting to the DB...or should I just insert the number into the DB, and then print the name out on the page that gets the info from the DB?

 

Also, how should I go about converting the time?

 

Thanks.

 

Brian

Link to comment
Share on other sites

Names can be pulled by lookup the number, which I presume is unique for each team (though not across seasons).  As for the time, decide which way to you want to store it, and the convert it back if you need to.  The TIME field will be useful for this.

Link to comment
Share on other sites

Here's what I've come up with...but I'm getting an error:

 

<?php
if {
$_POST[team] = "BSU";
  switch ($_REQUEST['assist1']) {
   case "1": $assist1 = "player 1 name"; break;
   case "3": $assist1 = "player 3 name"; break;

}
else {
  switch ($_REQUEST['assist1']) {
  case "1": $assist1 = "player 1 name"; break;
   case "3": $assist1 = "player 3 name"; break;
   }
}
?>

 

What I'm trying to do is if the team is the home team, enter their names...if not, enter the visitors name. 

 

Parse error: syntax error, unexpected '{', expecting '(' in goal.php on line 2
Link to comment
Share on other sites

Ignore the last one...figured out that error...here's the new one.

 

<?php
if ( $_POST[team] == "BSU" ) {

   switch ($_REQUEST['goal']) {
   case "1": $goal = "player 1 name"; break;
   case "2": $goal = "player 2 name"; break;

}
else {
  switch ($_REQUEST['goal']) {
   case "1": $goal = "player 1 name"; break;
   case "2": $goal = "player 2 name"; break;

   }
}
?>

 

Parse error: syntax error, unexpected T_ELSE in /goal.php on line 9
Link to comment
Share on other sites

I got it...

 

<?php
if ( $_POST[team] == "BSU" ) {

   switch ($_REQUEST['goal']) {
   case "1": $goal = "player 1 name"; break;
   case "2": $goal = "player 2 name"; break;
}
}
elseif ( $_POST[team] != "BSU" ) {
  switch ($_REQUEST['goal']) {
   case "1": $goal = "player 1 name"; break;
   case "2": $goal = "player 2 name"; break;

   }
}

?>

 

Thanks for all the help guys!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.