database queries needed enclosing quotes

The queries on lines 493 and 506 pass a text argument without enclosing
quotes.  The patch adds the missing quotes.
Merge pull request #4 from rghammonds/master

database queries needed enclosing quotes