Making changes to new settings, added form and sql code + validation.

All appears to be working correctly.