Security database connection

I added in a class to allow for checking credentials.  made a few
changes to sql syntax, still getting errors on insert and delete.