Can someone give me debugging tips for working with Template::Plugin::DBI?

Maybe it's the flu getting to me, but I'm not seeing what I'm doing wrong
with this usage.  It's not sorting like I expect:  It's sorting by "title"
not "sortorder,title".  sortorder is a number.

[% USE DBI(database.dsn, database.user, database.password) %]
[% query = DBI.prepare('SELECT name, title FROM people WHERE type = ? and
display = "yes" ORDER BY ?,?') %]

[% PROCESS displayperson FOREACH item = DBI.execute(
'manager','sortorder','title' ) %]

The above sorts by title.

But when I run this little script it sorts as expected:

>cat x.pl
use strict;
use DBI;

my $dbh = DBI->connect('dbi:mysql:foo','foo', 'pass' ) or die $!;

my $sh = $dbh->prepare( 'SELECT name, title, sortorder FROM people WHERE
type = ? and display = "yes" ORDER BY ?,?');
my $foo = $sh->execute('manager','sortorder','title');

while ( my @row = $sh->fetchrow_array ) {
   print "@row\n";
}

That sorts as by sortorder then by title.


>perl -MTemplate -le 'print $Template::VERSION'
2.05

Thanks,
-- 
Bill Moseley
mailto:[EMAIL PROTECTED]


Reply via email to