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

Thomas J.M. Burton tom at globalfocusdm.com
Wed Jun 23 17:52:47 EDT 2004


Mike Heins wrote:
> Quoting Thomas J.M. Burton (tom at globalfocusdm.com):
*SNIP*
>>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.
*SNIP*
>>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.
*SNIP*
> 
> I don't understand why you are only getting two things, but I think
> you have a more basic thing that should be done.
> 
> This is normal for IC:
> 
>    [perl tables="promotions"]
>      # Query promotions table
>      my $sql = qq{SELECT code,discount_amount
>         FROM promotions ORDER BY type,active_month};
> 
>      my $db = $Db{promotions};
>  
>      my $hash_results = $db->query({ sql => $sql, hashref => 1 });
>  
>      # Loop through query results, output text
>      foreach my $row (@$hash_results) {
>        $out.= "$row->{code}	";
>        $out.= "$row->{discount_amount}\n";
>      }
>  
>      return $out;
>    [/perl]


Thanks for the tip, Mike. It's nice to have a simple example of how that 
code should be done. However, this does still leave me with my 
problem...and if you don't know why the full query results are not being 
returned, then who does?

BTW, I'm not seeing anything in the catalog's error log related to this 
problem.

Thanks again,
Tom

-- 
________________________________________
Thomas J.M. Burton
Design & Production Director
Global Focus Digital Media, LLC
www.globalfocusdm.com



More information about the interchange-users mailing list