Jump to content

Recommended Posts

A while back I was bored and decided I'd write a simple site for tracking progress in my local 8 Ball Pool league, it gradually got more complicated as I added more features and I'll no doubt end up posting a few threads in the MySQL section about sorting out some of the querys, but thats another matter. I'm sort of stuck as to where to go from here.

 

The site currently allows me to track venues, teams and players in independent leagues. Our local league actually runs various different competitions each season. In the winter season there is the 'normal' league, but there is also knock out cups including singles, doubles, super 4s, divisional cup and league cup. My problem is I'm not entirely sure a.) how to implent a knockout ladder system correctly b.) how to integrate it with what I currently have.

 

If you want you can check out what the site currently looks like...

http://www.meltonpool.netii.net

username: test@test.com

password: test

 

I've attached a diagram showing a basic outline of my database structure. Any help or advice would be greatly appreciated.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/178475-league-site/
Share on other sites

Could you explain the knock out ladder system.  I believe that would help determine how to implement the db. 

 

 

My first thought is that their will be a table with users info and a table with the ladder.  Each would be given an initial ranking (user_ranking) and as they play each other and if someone beats a higher ranked user the DB would be updated by getting the ranking from the db and then swapping the values.

 


Pseudocode

create user table
create ladder table
assign initial ranking to each user
competition
        when player1 and player2 play
               if the lower rank player wins 
                        then retrieve the ranks and switch
               else
                        nothing
viewing rankings
      select * from ladder table order by ranking ASC

 

This is just a draft and I may be way off

Link to comment
https://forums.phpfreaks.com/topic/178475-league-site/#findComment-941296
Share on other sites

Ladder wasn't perhaps the best term to use. They are knockout cups ie you start with x amount of teams, after each round you have x/2 teams left in the tournament. You win, you move on, you loose, your knocked out. Basically like the latter stages of pretty much any sporting cup. Eg. Wimbledon, the World Cup, the FA Cup, etc, etc.

Link to comment
https://forums.phpfreaks.com/topic/178475-league-site/#findComment-941316
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.