
mat at bibliopolis
Oct 13, 2009, 10:32 AM
Post #1 of 2
(680 views)
Permalink
|
|
Database connection in AddDirective sub
|
|
Hi Everyone, I am using AddDirective and would like to pull some data from a DB table and store it in $Config. I am having trouble with connecting to the database. Using the example code below, the connection always fails, even though the table exists. GlobalSub <<EOS sub declare_extra_config { package Vend::Config; sub parse_foobar { my ($directive,$value) = @_; return undef unless $value =~ /yes/i; my $db = Vend::Data::database_exists_ref('products') or die "Couldn't get handle to table products'!"; # some more code here eventually to add data to $Config 1; } } EOS AddDirective Foobar foobar Foobar Yes, is set at the end of my catalog.cfg file after the Database setup section. Any thoughts? Regards, Mat _______________________________________________ interchange-users mailing list interchange-users [at] icdevgroup http://www.icdevgroup.org/mailman/listinfo/interchange-users
|