I am running a page through Drupal so that it renders a form on the page from a SQL database. That is working OK. I've put in textfields and a button at the bottom so users can enter in rows to the database. That is also working OK. The database updates and all is fine.
The issue I'm having is that every page refresh re-adds the data they just entered on a new line, creating duplication. Even when there is no text in the fields, it remembers what was typed from before and re-adds it. I'm assuming it has something to do with my variables storing the information.
I have tried nulling the variables before and after the SQL statements run, but that has not fixed the issue. Is someone able to have a look at tell me if they see anything?
My code is here - http://codepaste.net/rduqaw