Each lesson plan has a unique identifier. At first, the software created a new blank lesson plan, with mysql auto incrementing the unique identifier from the last one. But, people being what they are, would "accidentally" create one, and I started to get a ton of blank plans in the database. (This was actually pre-release, and I was doing all of this.
My fix was to ask mysql what the next identifier _should_ be. If the "back" button on the browser is pressed, no new row is created in the lesson plan table in mysql. When the lesson plan was saved for the first time, the unique identifier was saved as well. This worked fine, because I was the only one creating lesson plans for a while. (My boss had me doing all of hers.) When we hired a second person, a big flaw was noticed.
If the two of us wanted to create new lesson plans at roughly the same time, each of our separate browsers would hold the same "unique" identifier. Lesson plans could be hijacked by accident. My work around for the past 2 years has been to tell people to "create and save right away." We now have 6 people writing lesson plans, and I seriously need to figure out a new strategy.
I took a week off to write major software upgrades, so I hope I get some good advice on this soon. Thanks
--Dave