Hi,
Not sure what the best way to go about this is, hoping someone could guide me in the right direction.
When a form is submitted, I perform validation with PHP, if everything is okay, I insert the data into the database.
I have another page in which I am able to edit the entries (submitted above), so I display the entires, the user clicks edit (a single entry), and it populates the original form. They make changes and submit again.
Here is the problem, if they submit again, it will create another entry, all I want to do is edit the existing entry, but all the code would pretty much be the same besides the insert/update query, since I want to perform all the validation again.
Could I use a hidden field in the form indicating update/insert, and check that before I perform the query?
Could I send the calling script to the form, and send that to the validation script? and based on the URL, perform the update/insert?
Thanks!