0

メールを送信する perl test.pl ページがあります。電子メールには、html ページ linkfromTest.html へのリンクが含まれています。

(Interchange は、Interchange Development Group が提供する Perl で記述された Web ベースのアプリケーション フレームワークです。ホームページ: http://www.icdevgroup.org/i/dev )

しかし、SQL クエリを実行するには、linkfromTest.html ページで test.pl '$ref->{'outofstock_prod'}' が必要です。

 test.pl

$sql = "select OS.id,OS.name,OS.date,OS.customer_email,OS.product as outofstock_prod,OS.salesperson_email,OS.salesperson
    from outofstock_sku as OS 
    where mail_sent='0'
    order by OS.id";

$ref->{'outofstock_prod'}
......
......
print MAIL "More items potentially matched.\n\n";
print MAIL "Click here to view more items : http://qqq.qqqq.com/linkfromTest.html\n\n";
.....




linkfromTest.html


    [query list=1 sql="select P.sku,P.manufacturer,P.category,P.scat,P.description,P.imgid
                from 
                products AS P LEFT JOIN inventory AS I 
                ON (I.sku = P.sku AND I.status = 'A') 
                WHERE P.manufacturer LIKE  '$ref->{'outofstock_prod'}''
                LIMIT 0,4;"]    

前もって感謝します

4

1 に答える 1

0

スクラッチ スペースに一時変数を設定してみてください。

test.pl で:

$Tag->tmp('outofstock_prod');  # remove this when done
$Scratch->{outofstock_prod} = $ref->{outofstock_prod};

次に、linkFromTest.html で:

    [query list=1 sql="select P.sku,P.manufacturer,P.category,P.scat,P.description,P.imgid
            from 
            products AS P LEFT JOIN inventory AS I 
            ON (I.sku = P.sku AND I.status = 'A') 
            WHERE P.manufacturer LIKE  '[scratch outofstock_prod]'
            LIMIT 0,4;"]

(何がフィールドに含まれているの$refか、またはそのoutofstock_prodフィールドに何が含まれているのかわかりません。文字列でない場合は、に貼り付ける前に文字列を作成する必要がある場合があります$Scratch。)

于 2012-11-17T05:25:36.040 に答える