replace mysql functions with queryDB()