MySQL Functions for Front-End. (Ajax)