changed random method, optimised sql code
modified dbuser