OO mysql for functions