Jump to content

Search the Community

Showing results for tags 'rank'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I am writing a golf league management system and one request is to give points for lowest net score. Simple enough. Now when there is a tie I need to go back starting at the first hole and get the lowest score and if a tie move to the next hole and so on. Also there can be more than one division so I have the division seperated. Here is the array containing the players that have tied. In the example below A is the division the next is the Players unique id and ppoints is what they would have gotten if there was no tie. Not all this information is needed but have it in the array until the script is complete. The s_id is needed to update the database which has already been populated with the scores. Array ( [A] => Array ( [193] => Array ( [s_id] => 9 [pid] => 193 [ppoints] => 6 [net] => 31 [tie] => yes ) [199] => Array ( [s_id] => 10 [pid] => 199 [ppoints] => 7 [net] => 31 [tie] => yes ) [191] => Array ( [s_id] => 5 [pid] => 191 [ppoints] => 5 [net] => 31 [tie] => yes ) ) [B] => Array ( [202] => Array ( [s_id] => 8 [pid] => 202 [ppoints] => 6 [net] => 25 [tie] => yes ) [194] => Array ( [s_id] => 11 [pid] => 194 [ppoints] => 7 [net] => 25 [tie] => yes ) ) ) This array is the strokes achieved by each golfer. So you have the unique id and then h1 is hole1 and so on. Array ( [189] => Array ( [h1] => 4 [h2] => 4 [h3] => 5 [h4] => 4 [h5] => 5 [h6] => 4 [h7] => 3 [h8] => 5 [h9] => 5 ) [203] => Array ( [h1] => 4 [h2] => 4 [h3] => 5 [h4] => 5 [h5] => 5 [h6] => 5 [h7] => 4 [h8] => 5 [h9] => 5 ) [190] => Array ( [h1] => 4 [h2] => 4 [h3] => 4 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [204] => Array ( [h1] => 5 [h2] => 4 [h3] => 4 [h4] => 4 [h5] => 5 [h6] => 5 [h7] => 5 [h8] => 4 [h9] => 6 ) [191] => Array ( [h1] => 4 [h2] => 4 [h3] => 4 [h4] => 3 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 5 ) [201] => Array ( [h1] => 4 [h2] => 4 [h3] => 4 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [192] => Array ( [h1] => 4 [h2] => 4 [h3] => 4 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [202] => Array ( [h1] => 4 [h2] => 4 [h3] => 4 [h4] => 5 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [193] => Array ( [h1] => 4 [h2] => 5 [h3] => 4 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [199] => Array ( [h1] => 5 [h2] => 4 [h3] => 4 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [194] => Array ( [h1] => 4 [h2] => 4 [h3] => 5 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [200] => Array ( [h1] => 4 [h2] => 4 [h3] => 4 [h4] => 4 [h5] => 4 [h6] => 4 [h7] => 4 [h8] => 4 [h9] => 4 ) [195] => Array ( [h1] => 5 [h2] => 5 [h3] => 5 [h4] => 5 [h5] => 5 [h6] => 5 [h7] => 5 [h8] => 5 [h9] => 5 ) [197] => Array ( [h1] => 5 [h2] => 5 [h3] => 5 [h4] => 5 [h5] => 5 [h6] => 5 [h7] => 5 [h8] => 5 [h9] => 6 ) [196] => Array ( [h1] => 5 [h2] => 5 [h3] => 5 [h4] => 5 [h5] => 5 [h6] => 5 [h7] => 5 [h8] => 5 [h9] => 5 ) [198] => Array ( [h1] => 5 [h2] => 5 [h3] => 5 [h4] => 5 [h5] => 5 [h6] => 5 [h7] => 5 [h8] => 5 [h9] => 5 ) ) So here's what needs to happen. Those 3 in the first division who have ties need to compare scores. So first hole 193 and 191 got 4 sonot they move to the second hole. 191 got a 4 so he ranks first so 193 would rank second and 199 would be third. I need a loop to compare all thrugh the 9 holes just in case it goes till the end. Hope I explained it well enough. Thanks in advance for the help.
×
×
  • 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.