"mySQL provides standard SQL pattern matching"
--- reference manual(3.23.0) section 8.3.4.7
The SELECT statement would be something like:
SELECT ... FROM table WHERE field1 LIKE "%keyword1%" AND
field2 LIKE "%keyword1%" AND
field1 LIKE "%keyword2%" AND
field2 LIKE "%keyword2%"
To obtain keywords from the browser FORM use
req.getParameter()
Claude
Keith Wong wrote:
Hi,
I get the problem of query the database by several keywords (1 to 5)
from two field, keywords should be in both of two field. Do we have any
function to do it in mysql? Here are several things need to be
concerned:
User can input the 1 to 5 keywords in the search engine. The statement
is dynamically created for the servlets-mysql query.
Thanks
Keith.
---------------------------------------------------------------------