[ic] Data tag not returning result

Paul Jordan paul at gishnetwork.com
Wed May 12 23:39:21 EDT 2004


Tim Good [tim.g at edsd.com] wrote:
>> -----Original Message-----
>> From: interchange-users-bounces at icdevgroup.org
>> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf Of Paul
>> Jordan Sent: Wednesday, May 12, 2004 12:45 PM
>> To: interchange-users at icdevgroup.org
>> Subject: RE: [ic] Data tag not returning result
>>
>>
>> interchange-users-bounces at icdevgroup.org wrote:
>>>> -----Original Message-----
>>>> From: interchange-users-bounces at icdevgroup.org
>>>> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf Of
>>>> Paul Jordan Sent: Wednesday, May 12, 2004 11:16 AM
>>>> To: interchange-users at icdevgroup.org
>>>> Subject: RE: [ic] Data tag not returning result
>>>>
>>>>
>>>> Tim Good [draco at edsd.com] wrote:
>>>>> Hello list,
>>>>>
>>>>> (mysql 3.23.58 on Redhat 8.0 non threaded perl 5.8.2 interchange
>>>>> 5.2 stable) I have a custom table I have added to my database
>>>>> "delivery_schedule". In the order_view page, in admin, I would
>>>>> like to pull data from this table
>>>>>
>>>>> according to the order_number being viewed. I have a field
>>>>> "order_number" in the delivery_schedule table which get the
>>>>> order_number from transactions when the order is placed.
>>>>>
>>>>> I have tried several different approaches to solve this task.
>>>>> However, none are working. What is the best way to do this?
>>>>>
>>>>> Thanks much,
>>>>> Tim
>>>>>
>>>>
>>>>
>>>> Next time include code we can help fix.
>>>>
>>>>
>>>>     [query
>>>>         ml=100
>>>>         type=list
>>>>         sp="@@MV_PAGE@@"
>>>>         sql=|
>>>>             SELECT  foo, bar
>>>>             FROM    delivery_schedule
>>>>             WHERE   order_number = '[however your getting the
>>>>          order number]' |]
>>>>         [on-match]
>>>>             Delivery Detial:
>>>>         [/on-match]
>>>>         [list]
>>>>             Delivery Schedule #[sql-increment]: [sql-bar]<br>
>>>>             [/list] [no-match] Order is not yet in transit
>>>>         [/no-match]
>>>>     [/query]
>>>>
>>>>
>>>> ----------
>>>>
>>>> [however your getting the order number] is however you can grab the
>>>> order number on that page, maybe a CGI arg, or a value, or
>>>> scratch, i dunno, you'll have to see what it is giving you.
>>>>
>>>> HTH
>>>> Paul
>>>>
>>>>
>>> Paul,
>>>
>>> Thank you for the response. I was using the code below:
>>>
>>> [query sql="select charge from delivery_schedule where order_number
>>> = [loop-data transactions order_number]" type=list]
>>>     [if-sql-param charge]
>>>          [sql-param charge]
>>>     [/if-sql-param]
>>> [/query]
>>>
>>> However, I need to use the results in later areas eg. [total_view
>>> subtotal="[loop-data transactions subtotal]" install="[loop-data
>>> transactions install_chrg]" delivery="[sql-param charge]" ]

You do realize you cannot do:

[query sql="select charge from delivery_schedule where order_number =
[loop-data transactions order_number]" type=list]
   [if-sql-param charge]
          [sql-param charge]
   [/if-sql-param]
[/query]


Charge was: [sql-param charge]



>>> [perl table='delivery_schedule']
>>>   $Tag->data("delivery_schedule", "charge", "[loop-data transactions
>>> order_number]"); [/perl] This returns nothing.

Try:

[perl table="delivery_schedule"]
 $Scratch->{del_charge} = $Tag->data('delivery_schedule', 'charge',
$CGI->{order});
[/perl]

Charge was: [scratch del_charge]


Paul




More information about the interchange-users mailing list