On Mon, 2 Feb 2004, Shanta McBain wrote:

> On February 2, 2004 13:10, Dave Cash wrote:
> > On Mon, 2 Feb 2004, Shanta McBain wrote:
> > > How do you pass the host name ie localhost?
> > > Dose anyone has a working example I can hack?
> >
> > I'm not sure the lack of hostname is the problem, as I think DBI
> > defaults to localhost.  But since the database argument is just a
> > regular DBI dsn, you could do this:
> >
> >   [% USE DBI( database = 'dbi:mysql:forager;host=localhost',
> >               username = 'user',
> >               password = 'pw' )
> >   %]
> >
> > I haven't tested that, but I think it should work.  However, I'm not
> > convinced it will solve your problem.
> 
> Thanks Dave 
> But It is not connecting to the db. I can access no problem from Perl. using 
> DBI. 

Try doing this instead:

  [% USE DBI( data_source = 'dbi:mysql:forager',
              username = 'user',
              password = 'pw' )
  %]

If that works, you're using an old version of Template::Plugin::DBI.
You should also be able to do this:

  [% USE DBI( 'dbi:mysql:forager', 'user', 'pw' ) %] 

Take care,

Dave

/L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\
Dave Cash                              Power to the People!
Frolicking in Fields of Garlic               Right On-Line!
[EMAIL PROTECTED]                                  Dig it all.


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

Reply via email to