Adding php database functionality