I have a MySQL database which holds the records for an annual Horticulture and Craft exhibition. The database holds user details with entrant details along with the divisions and classes each entrant wishes to enter for the coming year.
We like to change the contestant number each year to avoid the possibility of cheating. We usually have between 150 and 200 entrants over 190 classes in 12 divisions with around 1100 entries.
Against each entrant we need to create a unique entrant number as their contestant number for the coming year.
The online system I have built works well apart from two things I an stuck on and need some help please.
At the moment each new entrant contestant number is set to 0. However if they have entered the previous year they will still have the contestant number from the previous year.
I am looking at creating a PHP/MySQL script which I can run which will set ALL entrants entry number (contestant number) to 0.
I am looking for a PHP/MySQL script I can use to insert a new contestant number which creates an incrementing number for each contestant who has entries this year. I need to be able to set the starting number and then assign the number to each active entrant as this years contestant number.
Any help and guidance in how I can achieve this will be appreciated.
Thanks in advance