while ($row = mysql_fetch_array($query))

{

$li1[] = $row[0];

$li2[] = $row[1];

$li3[] = $row[2];

}

$template=$li2[4];