added functions for mysql database queries