[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] field matching/searching against an SQL database
****** message to minivend-users from Fraser Campbell <fraser@starnix.com> ******
Hi everyone,
I am trying to design a search form that searches 4 database fields. The
products database is in MySQL. Minivend version is 3.14-5. Here are the
basic fields for my search form
<FORM ACTION="[process-target main]" METHOD=POST>
<INPUT TYPE="hidden" NAME="mv_doit" VALUE="search">
<INPUT TYPE="hidden" NAME="mv_coordinate" VALUE="yes">
<INPUT TYPE="hidden" NAME="mv_substring_match" VALUE="yes">
<INPUT TYPE="hidden" NAME="mv_search_field" VALUE="code">
<INPUT TYPE="hidden" NAME="mv_substring_match" VALUE="yes">
<INPUT TYPE="hidden" NAME="mv_search_field" VALUE="description">
<INPUT TYPE="hidden" NAME="mv_substring_match" VALUE="yes">
<INPUT TYPE="hidden" NAME="mv_search_field" VALUE="category">
<INPUT TYPE="hidden" NAME="mv_substring_match" VALUE="no">
<INPUT TYPE="hidden" NAME="mv_search_field" VALUE="mfg">
<INPUT TYPE="hidden" NAME="mv_searchtype" VALUE="sql">
...
</FORM>
I have 4 mv_searchspec fields. The first 2 are text fields, the last 2 are
select fields.
The manual states that "Even if the user leaves one blank, the search will
work." ... I have found that this is not true. I have tried using
mv_search_map and found that then the search becomes 100% broken instead of
only 50% broken. Can individual fields be matched in a query to an SQL
database or is this functionality not available in minivend 3.14? At the
end of this letter, I give more details on my problem if you need it ...
thanks for any insight!
Fraser
If I enter/select values for all 4 fields no problem, if I do not
enter/select values for every field then unpredictable things happen.
1. If I enter or select values only for one of the middle two
mv_searchspec's then the search fails ... it finds every single part based
on %% wildcard match on every field. However, if I select only the last
mv_searchspec (mfg) the sql query is correct.
2. If I enter a value for the only first mv_searchspec (code), then that
value is used in the query against every field ... not exactly the
behaviour I want (although it might be good enough in this case).
3. If I enter values in the first two mv_searchspec fields (code and
description) then the first value (given in code) is used in the query
against every field (same as in point 2 above).
4. Enter a value for the first and last mv_searchspec (skipping middle
two) results in a correct query.
5 ... I'll stop now. Basically what I am doing does not work in many
instances. The manual
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list