#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Norfolk, UK
    Posts
    16
    Rep Power
    0
    Hi (again),

    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.

    Thanks.


    Matt
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Norfolk, UK
    Posts
    16
    Rep Power
    0
    Thanks, I have got it working now. It was actually simplier than I thought it would be.

Similar Threads

  1. Need advice designing a usage tracking database (MySQL)
    By Randolpho in forum Database Management
    Replies: 0
    Last Post: February 13th, 2004, 04:11 PM
  2. Replies: 3
    Last Post: February 11th, 2004, 08:30 AM
  3. Replies: 14
    Last Post: February 8th, 2004, 01:28 PM
  4. MYSQL database
    By isheikh in forum MySQL Help
    Replies: 3
    Last Post: January 14th, 2004, 10:58 PM
  5. Writing Japanese unicode text to a mysql database
    By jayhay in forum PHP Development
    Replies: 3
    Last Post: January 13th, 2004, 08:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo