Added helper function to database php