Make mySQL functions work with tp function