db connect moved to a function
fixed missing single quote for edit form