On Tue, 2006-09-12 at 14:41 +0100, Dave Howorth wrote:
> Jeremiah Foster wrote:
> > Is there a syntax for adding a remote host in the foo.tt file to access
> > a database that I should know? Or do I have to do everything from the
> > local host?
>
> There's nothing special I know of. Just give the DSN to USE DBI:
>
> USE DBI( my_dsn );
>
I am doing something similar;
[% USE DBI %] [% DBI.connect('dbi:mysql:my_website', 'db_user',
'double_extra_secret') %]
Then I am doing
[% FOREACH item = DBI.query('SELECT * from table') %]
But if I change the DBI.connect line to include my remote host thusly;
[% USE DBI %] [% DBI.connect('dbi:mysql:my_website', 'db_user',
'double_extra_secret', 'remote_host') %]
it fails to work. This is why I suspect a syntax error despite the lack
of warnings in the logs, perl -C saying no syntax issues and no mention
of a remote host in perldoc DBI::Template::Plugins.
I must be doing something wrong. Just not sure where.
> If you're doing that already, then double-check what user you're running
> as and whether that user has permissions. If this isn't what you're
> doing, posting some of your code would be useful.
>
> Cheers, Dave
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates