[ic] Nested Queries

Jason Korkin jkorkin@korksoft.com
Thu, 12 Apr 2001 13:47:26 -0400


Hello all...

I'm trying to setup a nested query... here is what I have (most pulled from
mailing list archives):

[query sql="SELECT * FROM package_data WHERE pid='[value package]'" list=1
interpolate=1]
        [set token][sql-param sku][/set]
        [mvasp tables="products"]
        <%

        my $retval = "";
        my $dbh = $Sql{products};
        my $sql_query = "SELECT * FROM products WHERE
sku='$Scratch->{token}'";

        my $sth = $dbh->prepare($sql_query) or return error_message("can't
open products database");
        my $rc  = $sth->execute() or return HTML("can't open products
database");

        while($sku = $sth->fetchrow_arrayref()) {
                $retval .= "$sku->[0]|";
        }

        return $retval;
        %>
        [/mvasp]
[/query]

When I pull up the page, I get nothing; no results... I'm running IC 4.6.0
under RH Linux 7.  Any help would be appreciated...

Thanks in advance,

Jason Korkin.
President
Korksoft LLC
http://www.korksoft.com