I am trying to create a tournament brackets app. I am still in the process of working on it so it is not complete. I am looking to have people look at it provide feedback and possibly suggest ideas on how to move forward.
I am just now somewhat learning PHP and do not know the ends and out of it. I have a concern that if multiple people access the page at the same time and update the database as other people are in other pages it might cause issues.
Pretty much the app is adding teams to a database then starting a tournament. Once you complete a game you go to app to submit the scores and then move on to the next round. Continue the process till you get to a winner.
Please provide some feedback
This is nicely implemented so far.
The one thing that stood out to me was the full page refresh that happens every time you delete a team. That feels a little clunky when compared to modern apps.
You can fix that the old way with AJAX requests and some DOM manipulation with normal JS or jQuery, or you could lean on a modern framework like React or Vue which is designed for this kind of single page app you are building.
As for your concurrent database user fears, don’t worry about it. My guess is that you’re using mysql? That, and most databases, are very well optimised for handling incoming requests from multiple users. As long as your tables and indecies are sensible, you’ll be fine.
However, because you don’t have user accounts or multiple tournaments as far as I can tell, having lots of people editing the same page could be an issue, depending on your code logic. It’s been ages since I touched PHP and mysql, so I couldn’t tell you what happens if I try to delete a team someone already deleted. But if you handle that kind of exception correctly you’ll be fine.
Thanks for feedback.
On my localHost server I have no issues with deleting. When I moved files over to this free webhosting server I get an error with page headers already been sent. So I did a workaround for this. I can not update php config file or i have not looked into doing that. Just a temp location to host app for now.