// calling $taglist in the template
eval("dooutput(\"".gettemplate("cc_tag_test")."\");");
Note that its $taglist .= .... the . appends the content onto the end of the variable while just = overwrites it each time meaning that $taglist at the end only contains the last result from the query.