February 22nd, 2000, 06:03 AM
I have a customer database from which I want to search. ie Enter a view keywords into a form box and then return a list of records which match up (in some sort of order)
I have been looking through the docs and can only find case sensitive searches.
Can I use the REGEXP with a /i option for case insensitive searches.
If anyone knows of a generic database search script it would come in really handy.
February 22nd, 2000, 02:22 PM
You can use LIKE for case insensitive searches. If you need more pattern matching than _ or % provide, then you would have to force the field and pattern to similar case using lcase() or similar.
However, if you are only searching for text search terms LIKE should be more than sufficient as you are using whole words not matching a pattern within a word.
BTW, make sure your fields are case insensitive as well. BLOB is case sensitive, as are TEXT, VARCHAR and CHAR if you use the BINARY keyword when defining the table/field.
February 23rd, 2000, 04:45 AM
Thanks, I have got it working now. It was actually simplier than I thought it would be.