-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evan Kaufman wrote:
> And then, on the perl side, I specify the dbh, and the query:
> 
> my $dbh = DBI->connect("dsn-stuff");
> $tt->process("page.html",
>  {
>    global_dbh => \$dbh,
>    genre_query => "SELECT ID, Desc FROM Table;"
>  }
> );
> 
> Alas, when I request the page, I get nothing, and the httpd error log
> has this:
> 
> [Tue Jun 27 17:06:44 2006] [error] [client 71.2.112.154] undef error -
> Can't call method "execute" on an undefined value at
> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux/Template/Plugin/DBI.pm
> line 268., referer: http://pe6300.psx.net/catalog/
> 
> This doesn't make sense to me, because the query() method should do a
> prepare and an execute, right?

Yes, the prepare is failing, and returning undef for the statement
handle, which the DBI plugin then blindly calls execute on.

I would assume that your DBH is OK, but your statement isn't.  Could
it be the semicolon?  The DBI manpage (at the end of the blurb on
the prepare method) states that you should not put a semicolon at
the end of queries.  This could be causing your query to fail.

Or perhaps the "Table" table doesn't exist.  Or maybe your database
doesn't like tables being called "Table".  I certainly wouldn't like
that if I were an SQL database. :-)

HTH.
- --

C. Chad Wallace, B.Sc.
The Lodging Company
http://skihills.com/
OpenPGP Public Key ID: 0x262208A0


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEocwmKeSNHCYiCKARAodeAKDGiJa+GL9MdBJtClapoxZZNziLdACeKhiI
jJCBkBbcbPJvBJ+ysvuMzMc=
=Gw89
-----END PGP SIGNATURE-----

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to