[ic] simple search question :)

Andreas Lindenblatt interchange-users@lists.akopia.com
Mon Jun 4 20:05:01 2001


Hi all,

I'm stalling at a really simple thing at the moment and simply can't
figure out what the heck I'm doing wrong (tearing the rest of my hair
and banging my head on the keyboard by now :( ). 

IC V4.6.3 is running on a Mandrake7.2 using MySQL, the construct-demo is
doing fine, so I assume the setup in itself is correct.

I try to do a simple loop search ;-).

The page is called with a variable 'typ', its value is correct, and
'dummy' is also set to the correct value (tested by [scratch dummy] ).
What I want to get is data from all rows in 'products' containing the
'dummy' in the field 'subcategory_typ'.

The loop-search works ... uhm, sometimes. Most of the time - but not
always. 
Its looks like it is depending on the value of 'dummy' which can contain
a lot of spaces ',' '(' '/' and similiar stuff (eg. '3er-Reihe, Typ
3B,3C,3/CG (E36)').

The code works always for eg.:
3er-Reihe,346L/C/R, (E46)
6er-Reihe,Typ 6CS/1

never works (returns nothing) for:
3er-Reihe, Typ 3B,3C,3/CG (E36) 
5er-Reihe , Typ 5/D (E39)

and always gives more results than expected for eg.:
Audi 80
(results contain also 'Audi 80/90 Typ 81/85')

I assumed that by giving 'op=eq' and 'su=no' I asked to get only data
which fits exactly what I queried. 
A direct query of the MySQL on a prompt returns only the desired rows,
so there don't seem to be trailing spaces or something unusual in the
database. I already played with giving ' and " in different flavors, but
this had not the desired effect.

--- cut ---
[tmp dummy][data table=cat column=name key="[value typ]"][/tmp]
  <table cellpadding=5>
    <tr>
     <th>[scratch dummy]</th>
     <th>Description</th>
     <th>Price</th>
    </tr>
    [loop search="st=db/op=eq/su=no/sf=subcategory_typ/se=[scratch
dummy]"]
      <tr>
       <td>[loop-code] [loop-field subcategory_typ]</td>
       <td>[loop-field description]</td>
       <td align=right>[loop-field price]</td>
      </tr>
    [/loop]
  </table>
--- cut ---

It can't be much of an issue, it's clearly a every-day task for IC :).
Hopefully I only misinterpreted the usage of op and su, as changing the
values (stripping spaces an other chars) in subcategory_typ is not
possible.

-- 
----
BYE Andreas
------
[http://www.solution.de     |    Solution – The Computer People ]
[fax:+49-621-7140721        |    Mannheim/Germany               ]
[------                                                    -----]
[The best way to predict the future is to invent it - Alan Kay  ]