working with template files with placeholders to replace it with mysql query data or an array data