Completed the update function and built the sql
Added hidden form to differentiate between insert and update post data