add verify_code function to user

can probably do away with the entire if/else and just use the sql format to add the proper string into the sql query. Save on code duplication