i need good, flexible, quite easy template system (without hundreds of new functions - i dont want to learn completely new language

).
There are many template systems but i dont know which system i should choose.
i'll use template system only for creating multiple layouts and there'll be lots of menus created via mysql_fetch_row(array) command so this template system needs to work good especially with mysql.
i also need to have possibility to control every record fetched from mysql database
couple months ago i've tried some template system (dont remember its name) and i've only could display records from mysql db.
i couldn't edit some displayed rows ie.:
$result = mysql_query ($query);
while ($row = mysql_fetch_array($result)) {
//trying to edit ie. row[2]
$row[2] = str_replace ("Download", "blablabla", $row[2]);
$template->append('prospect_list',$row);
the template system displayed all records from database but didnt edit row[2] (there was a record with fraze "Download"). i dont know, maybe i've done something wrong or maybe template system was poor
Anyway,
Maybe someone has some experience about template systems and could give me some advice because i dont want to start again with bad template system
