[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[perl] question
I'm having some problems with some perl script on a page. The page is a
modified version of the flypage.html that comes with minivend. The perl
makes a sql query to the database and retrieves all of the related products
info for a given product using a minivend [sql] tag. The related products
info contains a field that has product codes seperated by ;'s. The perl
takes these product codes and places them in an array, and uses this array
to setup the links to the other products specified by the product codes.
The problem comes when the perl tries to pull the description info out of
the database for the product codes. The code works similar to this:
foreach $itemcode (@related_products) {
my $productdescriptionhash=<<'EOF';
[sql type=hash][arg]$itemcode[/arg]select description from products
where product_id = %s[/sql]
EOF
(more code)
The problem is that the sql query is processed to be:
select description from products where product_id = $itemcode
where $itemcode is literaly $itemcode instead of the value of $itemcode.
My question is how can I get minivend to process the perl variable before
it processes the [sql] tags?
Is it even possible?
Or is there another better way to display multiple related items on a page
without resorting to a perl script?