In your script, you're deleting the row from the addingprod table whenever the script is run. Is this right, or should the row only be deleted if the form submission is successful and the data is saved to the repplac table?

Also, in your form html, you're querying addingprod for the same data multiple times, which is very inefficient. You only need to run the query once at the top of the page: