[ic] Wierd behaviour mysql query - URGENT

Andrei Gologan interchange-users@icdevgroup.org
Wed Oct 16 08:59:00 2002



> On Wed, 16 Oct 2002 14:33:12 +0200
> "Andrei Gologan" <agologan@gmx.mis.de> wrote:
>
> > Hallo,
> >
> > we have following code that worked  until a few days:
> >
> > [if-item-data products limitiert eq 1]
> > [query list=1 sql="SELECT Id, quantity FROM menge WHERE username='[data
> > session username]' AND sku='[item-code]'"]
> > [on_match]
> > [if type=explicit compare="[calc][sql-param quantity] > 0 [/calc]"]
> >  <font __FFACE__ size="1" color="#008000"><b> [sql-param
> > quantity]</b></font>
> >  [else]
> > <font color=red>No</font>
> > [/else]
> > [/if]
> > [/on_match]
> >
> > [no_match]
> > <font color=red>No</font>
> > [/no_match]
> >
> >  [list]
> >  [/list]
> > [/query]
> > [else]
> > ..............
> > [/else]
>
> I don't see the closing [/if-item-data]
>

I cut that it is there, here the whole part, what i dont understand is why
it works only outside the if-item .....  :

[if-item-data products limitiert eq 1]
[query type=list sql="SELECT quantity FROM menge WHERE username='[data
session username]' AND sku='[item-code]'"]

[on_match]
[if type=explicit compare="[calc][sql-param quantity] > 0 [/calc]"]
 <font __FFACE__ size="1" color="#008000"><b> [sql-param
quantity]</b></font>
 [else]
<font color=red>Nein</font>
[/else]
[/if]
[/on_match]

[list][/list]
[no_match]
<font color=red>Nein</font>
[/no_match]


[/query]



[else]
        [item-calc]
        my $q = q{[item-data inventory quantity]};
        if($q > 0) {
                return <<EOF;
<font __FFACE__ size="1" color="#008000"><b>[item-data inventory
quantity]</b></font>
EOF
        }
        else {
                return <<EOF;
<font color=red>Nein</font>
EOF
        }

[/item-calc]
[/else]
[/if-item-data]