I'm assuming your users arnt using a MySQL client directly to perform
the queries... And your using middleware like PHP or something.

So your PHP code can parse the users responses and then design your SQL
queries around your parsed data.


-----Original Message-----
From: BadgerBay [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 06, 2002 10:10 AM
To: [EMAIL PROTECTED]
Subject: SQL coding: Finding singular when search with plural.

Hello,

This is a good question for when you are sipping coffee or tea and are
inspired to write some code. I require additional functionality for my
SQL
search:

MY CURRENT SEARCH

SELECT ID, Authors, Year, Title FROM libraryTable
WHERE (Authors LIKE '%" + varAuthor + "%')
OR (Keywords LIKE '%" + varKeyword + "%')
OR (Title LIKE '%" + varTitle + "%')";
ORDER BY Year;

ADDITIONAL FUNCTIONALITY REQUIRED
1) The search should be able to locate singular words when the plural (s
or
es) is entered.
Example: If "singers" is entered in the search box, than "singer" would
be
found.

2)When two or more words are entered in search box (for example, into
the
variable varTitle), each word entered should be searched for separately.
So
if "Iyengar Yoga" is entered, than the records found might contain:
yoga
iyengar
India yoga style iyengar
yoga tai chi iyengar

3)The search should NOT locate words in which the search word is merely
a
component. So if "low" is entered in the search box:

SHOULD FIND:
low
lows

SHOULD NOT FIND
slow
below



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to