Jump to content

Recommended Posts

:-\ Kind of a strange title, but here's what I'm trying to do. I assume I'll need an array, which I am very poor at, so...

 

I have a table (competition results), which holds

competition id

competion level

username

user's scores

rank (calculated and stored based off scores)

points (currently empty)

count of users in the competition >> I may drop this if it's more efficient to obtain and count these when I'm calculating points instead of off on it's own, it's only there for point counting and a simple echo.

 

What I'd like is to calculate points based off of the level of the event, the player's placing, and the number of players entered in the event. I'd like to insert the points earned into the event result table for future reference and counting.

 

Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/171008-creating-dynamic-variable/
Share on other sites

I would suggest not having a count, and just getting the count whenever you calculate the points. if you really want to store the count, store it in a different table. (called competitions of something, which you could link to the other table via the unique competition id)

 

How exactly do you want to calculate the points? Is it simple math? What your describing sounds pretty straight forward. Just query the table, get the information for each player by iterating the mysql_results and update your other table.

I'm trying to build a points table of sorts... Let me see if I can get it on here :)

 

Top row represents # of entrants, left column represents rank

12345...

1st12345...

2nd01234...

 

etc... so that each time another entrant is there, the points go up. I wouldn't mind if they only went up in increments of 5 (so for every five entrants, points went up) and I only want up to 10th place player to be awarded points.

 

Does that help?

I am going to try making a point_scale table and getting the information from there... I'm sure there's a more efficient way of doing this, but this page also won't see a lot of traffic and won't be accessible to most people on the site, so it shouldn't be an issue at least until I can find a better way to do this. :)

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.