MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

SQL searches across all columns doesn't work



Ok, maybe it's late and I'm missing something very obvious, but at this time I'm at my witt's end and I've resorted to "the list"!

Here's my code:

<FORM ACTION="[process-search]" METHOD=POST>
<INPUT TYPE="hidden" NAME="mv_searchtype" VALUE="sql">
<INPUT TYPE=hidden NAME=mv_sql_query
  VALUE="select code from products where comment like '% ? %' or description like '% ? %' or category like '% ? %'">
<INPUT MAXLENGTH="30" NAME="mv_searchspec" SIZE="13" VALUE="">
<INPUT TYPE="submit" VALUE="Search">
</FORM>

If the word that's being searched for is in the "comment" column, the search succeeds and returns the appropriate results. But if the word is in either the  description or category column, it doesn't work. From the mysql logs, the search parameter is not being passed to the last two "?"'s, only the first. So, how does one search more than one column in the products table with sql in a single search text box?

Thanks.


Search for: Match: Format: Sort by: