2 messages in com.mysql.lists.javaRe: Query Statement
FromSent OnAttachments
Keith Wong25 Jan 2000 11:07 
LEBLANC, CLAUDE28 Jan 2000 09:27 
Subject:Re: Query Statement
From:LEBLANC, CLAUDE (clau@bell.ca)
Date:01/28/2000 09:27:53 AM
List:com.mysql.lists.java

"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.

---------------------------------------------------------------------