I'm new to Template::Toolkit but I t hink I'll rework my actual website using it. I got a Template
[% USE oracleDB = DBI("dbi:Oracle:dbname", "username", "password") %]
<html>
<body>
<table>
<tr>
<td>col1</td>
<td>col2</td>
<td>col3</td>
</tr>
[% query = oracleDB.prepare("
SELECT u.name, u.adress, u.idontknow
FROM user u, anothertable t, athirdtable d
WHERE u.id = t.user
AND t.id = d.something
ORDER BY u.name DESC") %]
[% FOREACH user = query.execute( ) %]
<tr>
<td>[% user.u.name %]</td>
<td>[% user.u.adress%]</td>
<td>[% user.u.idontknow %]</td>
</tr>
</table>
</body>
</html>
The query is actual working fine, i got the amount of wors I'm expecting, but just the col td is always empty. How do i access alias-based results?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|