Firstly, I wish you would edit this post and use the PHP code wrappers.
Secondly, I don't see any include/require files, so I am assuming that you are not using any constants. Therefore, there are a lot of other errors, some of which might be causing the error in question.
I recommend putting the following line in after your opening <?php tag -
For the constant values which should probably be quoted strings, I see a lot of code like the following -
Unless you have defined constants - Starter, Second, Third, ... this line (and everywhere else in the code) should be like this -
I don't see anything specific elsewhere in the file that would cause the error listed, but start by checking and correcting any errors reported with the above... Even if just a notice error is issued, this is logged and causes a small speed penalty when your code is executed.
Edit: I executed your code and I don't get a parse error. Hmm...
I notice a couple of other things that you need to address -
You are referencing a $_SESSION variable but are not starting a session. While it is possible that your PHP installation is setup to automatically start a session, this is unlikely.
There is no code to connect to a mysql server and select a database. While it is possible you have opened a persistent connection to the mysql server elsewhere, you still need to select a database prior to executing a query.