[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] simple search question :)
G'Day Andreas,
Try this instead....
[loop search="
st=sql
fi=products
sf=subcategory_typ
se='[scratch dummy]'
tf=0
rf=0
ml=250
"]
Insert Your Code Here.
[/loop]
Just a note the tf= paramter tells Interchange what field you want your results
sorted by. Zero means the product codes, any other column, just give it the
column name.
John Beima
[loop search="st=db/op=eq/su=no/sf=subcategory_typ/se=[scratch
>
Quoting Andreas Lindenblatt <azrael@solution.de>:
> 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 ]
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
>
John Beima
jbeima@palb.com, support@alocalagent.com, and support@alocalchurch.com
P.A.L.B. Systems - Phone: (780)451-1086 - Fax: (780)447-4760
11639-122 Street, Edmonton, Alberta, Canada, T5M 0B6
Affordable Web Pages - Phone: (888)932-9990 - Fax: (256)351-7297
2713B Spring Place SW, Decatur, Alabama, United States, 35603