in reply to weird print results

The problem as stated isn't really solveable - we lack the data or actual output (you said 'something like').

When you say that t isn't populated are you commenting on the html source, or where the link goes when you actually click on it?

If the latter, then perhaps one of the values being output needs to be escaped.