Is this code synchronized?
Posted: Tue Feb 12, 2008 2:22 am
Hi there,
I have a php script for a highscore table for a game I'm making. The basic flow of the code is this:
I'm doing this because my concern is that if I do this:
That if two players submit a highscore at the same time, they could potentially screw each other up if one read, the other read, then the first one wrote, and the second one wrote, etc.
Is this okay for me to do? If I'm not making sense I can clarify.
Thanks
I have a php script for a highscore table for a game I'm making. The basic flow of the code is this:
Code: Select all
Open highscore file (READ mode)
-read values
Open highscore file (WRITE mode)
-write new highscore
close highscore file (READ mode)
close highscore file(WRITE mode)Code: Select all
Open highscore file (READ mode)
-read values
close highscore file (READ mode)
Open highscore file (WRITE mode)
-write new highscore
close highscore file(WRITE mode)Is this okay for me to do? If I'm not making sense I can clarify.
Thanks