Fix getting the result
Give a proper parameter to the function
Make the function public, as it is used in the backend
Also set the proper parameter, use it in the db statement and use the propert DB object
Merge pull request #9 from boom1992/master

Fix getting the result