[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
sql bug with multiple mv_search_field parms?
In the following code snippet, the results are not exactly what I
expected. It builds two pull-down mv_searchspec selections. When the first
is left blank and the second is used, the sql query you get is "select
code from products where fixture_type like '%%' AND manufacturer like
'%Flos%' " This is what you want. However, when the first is used and the
second left blank, you get "select code from products where fixture_type
like '%Wall%' OR manufacturer like '%Wall%'" when what you want is "select
code from products where fixture type like '%Wall%' and manufacturer like
'%%'" or even better, it would leave off the "and manufacturer like '%%'"
part. The search it returns is always a superset of the intended
search, but you might get some unexpected stuff.
Can anyone point me to where I might patch this?
------snip-------
Browse by:
<FORM ACTION="[process-search]" METHOD=POST>
<INPUT TYPE="hidden" NAME="mv_searchtype" VALUE="sql">
<INPUT TYPE="hidden" NAME="mv_matchlimit" VALUE="15">
<INPUT TYPE="hidden" NAME="mv_return_all" VALUE="yes">
<INPUT TYPE="hidden" NAME="mv_search_field" VALUE="fixture_type">
<INPUT TYPE="hidden" NAME="mv_search_field" VALUE="manufacturer">
<INPUT TYPE="hidden" NAME="mv_case" VALUE="no">
<INPUT TYPE="hidden" NAME="mv_substring_match" VALUE="yes">
<SELECT NAME="mv_searchspec">
<OPTION SELECTED VALUE ="">Fixture Type
<OPTION>Wall
<OPTION>Ceiling
<OPTION>Suspension
<OPTION>Floor
<OPTION>Table
<OPTION>Recessed
</SELECT>
<SELECT NAME="mv_searchspec">
<OPTION SELECTED VALUE="">Manufacturer
<OPTION>Flos
<OPTION>LBL
<OPTION>Leucos
<OPTION>Luceplan
<OPTION>Neidhardt
<OPTION>Prisma
<OPTION>Resolute
<OPTION>SergioTerzani
<OPTION>Dunsford
<OPTION>Santa & Cole
<OPTION>Luce Custom
</SELECT>
<INPUT TYPE="submit" VALUE="Go">
</FORM>