#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0
    SORRY, I'm german, my english isn't good to reed!

    My problem is the follows:

    I'm looking for a statement searching anything from a database. I use this one and i will get only exact answers!
    $sql = "SELECT column FROM table WHERE(table.column LIKE '%$word%')";

    In table there is f.i. "Hallo" and if I have a look about "hallo" I will get an Emty! If I have a look about "Hallo" I will get "Hallo"!

    Can you help me, finding a statement wich will give back "Hallo" if I have ask "hallo"?

    SORRY again my english! I hope you can understand what I'm looking for.

    bye,
    Hannes
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    43
    Rep Power
    14
    Try this.
    $sql = "SELECT column FROM table WHERE lcase(table.column) REGEXP lcase($word)";
    Using REGEXP is far superior to LIKE because you can do things such as REGEXP lcase($word1|$word2). This will return all with word1 or word2 in it.
    Also the lcase(table.column) will turn everything into lowercase just for the query and make it a case insensitive query.

Similar Threads

  1. Frames hijacked after remote search
    By Telejoke in forum Antivirus Protection
    Replies: 2
    Last Post: September 26th, 2007, 09:32 AM
  2. Is there any alternative to fulltext search?
    By irishairpics in forum MySQL Help
    Replies: 2
    Last Post: December 10th, 2003, 02:40 PM
  3. Site html search with php?
    By stojan in forum PHP Development
    Replies: 1
    Last Post: November 17th, 2003, 09:20 PM
  4. Replies: 37
    Last Post: October 2nd, 2003, 08:09 AM
  5. search engine with 5 keys of search
    By metatad in forum MySQL Help
    Replies: 3
    Last Post: June 1st, 2003, 04:26 PM

IMN logo majestic logo threadwatch logo seochat tools logo