add table prefix to places missing in the query
Merge pull request #19 from yakatz/patch-1

add table prefix to places missing in the query

Reviewed-By: Peter Rotich <peter@osticket.com>