How can i make a simple scoring system in php?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natznetznitz
    New Member
    • Feb 2011
    • 8

    How can i make a simple scoring system in php?

    ive been working on a php project in which the main function is to add and record scores of a basketball game, but not necessarily by all the players but the score of a team, im having problem in computing for scores, i use switch statement that add 1, two , or three points to the initial score 0, but always return the same value as to what button is clicked, i dont know what logic is needed to make this work..

    can anyone help??

    any help would be much appreciated,tha nk you
  • dgreenhouse
    Recognized Expert Contributor
    • May 2008
    • 250

    #2
    You obviously need to store the values somehow; either in a database or a text file. Also, you'll probably want to structure your application to organize the stored information as: games, teams, team-scores. You'd need to either use "Sessions" or send some kind of value(s) to the application indicating which game/team scores the point(s).

    i.e.
    score.php?game= 1&team=1&points =3
    score.php?game= 6&team=1&points =2
    score.php?game= 10&team=2&point s=1

    Comment

    • natznetznitz
      New Member
      • Feb 2011
      • 8

      #3
      thanks..eventho ugh i didn't really understand your syntax, but your the logic you've given really works..

      thanks a lot..my project is done now..

      Comment

      Working...