[ic] RE: Interchange-users digest, Vol 1 #319 - 19 msgs

Annie Flippo aflippo@lunamedium.com
Fri, 23 Feb 2001 11:01:58 -0800


The database definitely exist because I'm able to access
thru the [loop  search="st=db/fi=product_cat ... "] method.
And I logged into mySQL database manually and checked.

Just to confirm the syntax is
[perl table=<table name> interpolate=1]
  my $db = $Db{<database name>};

or is it
[perl table=<table name> interpolate=1]
  my $db = $Db{<table name>};

I've tried both methods above and still get the same error.
I know what you mean by not getting the DB set.
I'm not set up properly somehow but what?


Quoting Annie Flippo (aflippo@lunamedium.com):
>
> My example is:
>
> <html>
>
> Going into perl.<br>
>
> [perl tables=product_cat interpolate=1]
>     my $db = $Db{product_cat};
>

      if(! $db) {
	  Log("product_cat database doesn't exist!");
	  return;
      }

You aren't even getting the DB set. The error "can't call method on
undefined
value" says that the $db is not set. Obviously something is missing....like
a Database product_cat .. something or other.

Once that is done, I think you have to do:

	my $set = $db->query(....);

The query method returns an array reference, not an array.

Then it should work.