Search Help Board

PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help

?Re: searching help !!
Date:???07-27-04 12:15

Searching on free formtext fields is tough, there is no way to control the user input...what you can do here to try and accommadate the vagaries of input

Split the input string on the spaces
Check each value to see if its numeric or alphanumeric.
If numeric, is it 4 or 2 digits long?
If 4, is greater than 1950(arbitrary year)?

If it passes all these tests then you know its the year and can plug it into the sql statement for the year search, taking only the last two digits

"...where $my_year > year_from and $my_year < year_to "

Then you basically do the same with the text


?Topics Author? Date
?searching help !!??new
Moses 07-26-04 20:47?
?Re: searching help !!??new
bastien 07-27-04 12:15?
?Re: searching help !!??new
Moses 07-28-04 10:50?
?Re: searching help !!??new
bastien 07-28-04 11:38?
?Re: searching help !!??new
Moses 07-29-04 09:59?
?Re: searching help !!??new
bastien 07-29-04 11:53?
?Re: searching help !!??new
Moses 07-30-04 14:27?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
New Topic
?Reply To This Message
?Your Name:
?Your Email:
Email replies to this thread, to the address above.

Provided By