[ic] search-region/query conflict? - Please Help

Thomas J.M. Burton tom at globalfocusdm.com
Wed Jun 23 16:50:26 EDT 2004

Hi IC users,

I'm reposting this question in a simplified form as it may make 
providing help easier. I've worked with the code a bit more since my 
original post but am still experiencing the same problem.

In a catalog I'm developing, I have a promotions table which will 
contain data for various promotions. In a file that I'm including in the 
page template, I am running a query on the promotions table to check for 
current promotions and then processing each result according to 
specifics based on promotion type.

This catalog is running in Interchange 5.0 and using the default DB.

The problem I'm encountering is that the query for the promotions table 
is only returning two results when it's used in the results.html page. 
Any other page in the catalog has the proper full set of results 
returned from the query.

As I mentioned, I've simplified the query code by doing all through perl 
(before I had a [query] tag with arrayref specified and processed the 
results in a chunk of perl code). Below is the code for the query and a 
simple output of results.

   [perl tables="promotions"]
     # Query promotions table
     my $sql = qq{SELECT code,discount_amount
        FROM promotions ORDER BY type,active_month};

     my $table = 'promotions';

     my ($results, $col_name_hashref, $col_name_arrayref)
         = $Tag->query({ sql => "$sql", table => "$table"});

     my $hash_results = $Tag->query( { sql => $sql,
        hashref => 'my_results' } );

     # Loop through query results, output text
     foreach my $row (@$hash_results) {
       $out.= "$row->{code}	";
       $out.= "$row->{discount_amount}\n";

     return $out;

Why would this return only a limited number of results (in this case, 
only 2) when included in the results.html page? I suspect it has 
something to do with there being a [search-region] in the results page, 
but I don't know what to do to prevent the conflict.

Can anyone provide an answer?


Thomas J.M. Burton
Lead Pixel Pusher/Code Monkey
Global Focus Digital Media, LLC

More information about the interchange-users mailing list