updated database call. deprecated dependency php-template.