[ic] search-region/query conflict? - Please Help
Mike Heins
mike at perusion.com
Wed Jun 23 18:16:37 EDT 2004
Quoting Thomas J.M. Burton (tom at globalfocusdm.com):
> 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?
If they are not being returned with that code, there is something wrong
with your database. I note you don't mention what it is or what its
structure and IC configuration is....
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.765.647.1295 tollfree 800-949-1889 <mike at perusion.com>
Experience is what allows you to recognize a mistake the second
time you make it. -- unknown
More information about the interchange-users
mailing list