[ic] sql query ...

Andrei Gologan interchange-users@icdevgroup.org
Tue Nov 26 05:10:01 2002


sql query problem, I am dying on this !!!!!

i have this code, it works on flypage and it does not work on results.html
!! The problem is when there is no data entered in the table menge, that
means the query returns empty. Why does it work on one page and not on the
other ??????
there are 2 different types of items with 2 inventory tables.

thnak you for any help !!!

[if-item-data products limitiert eq 1]
        [query type=list list=1 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>aa [sql-param quantity]</b></font>
                        [else]
                                <font color=red>Nein</font>
                        [/else]
                        [/if]
                [/on_match]

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

                [list]
                [/list]
        [/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]