[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Searching multiple columns in MySQL problem
I'm sorry to be posting this again, but I've still not come to any conclusion to this problem. Seeing how many questions, even newbie questions, get answered quite readily, I can only presume this question was overlooked, or that this problem has no solution. I'd rather believe the former.
I'm trying to do a blanket search of the products database, in 3 columns, for keywords.
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? is it just not possible? Do I have to create a glimpse search table every time the products table changes in mysql?
Any answer is welcome, even if it's not what I want to hear. Just knowing that _someone_ read this will make me feel better. :)
Thanks.
--
Daniel Ceregatti
Programmer - Digital Savant
Phone: (323) 848-7964 x106
Fax: (323) 871-2499
7039 Sunset Blvd., Suite 200
Hollywood, CA 90028