#1
  1. No Profile Picture
    razor
    Guest
    Devshed Newbie (0 - 499 posts)
    How do I use LIKE in case insensitive ?

    ------------------
    Regards:
    Christian Jørgensen
    http://wiktor.dk/~razor/
    http://www.freecounter.f2s.com
  2. #2
  3. No Profile Picture
    rod k
    Guest
    Devshed Newbie (0 - 499 posts)
    Case sensitivity for comparisons is determined by the data type. BLOBs are case sensitive, TEXT is not. VARCHAR and CHAR are case insensitive unless the keyword BINARY is used in it's definition.

    IOW, if you are trying to do a comparison on a BLOB there is no way to do a case insensitive comparison because it is binary.

    If it's not a BLOB then it will be case insensitive.

    ... OK, I just had an idea. You'd have to try this to see if it'll work (don't know why it wouldn't). You can change the BLOB to all lower or upper case before the comparison using LCASE or UCASE:

    select * from table where lcase("Your string here") like lcase(blobfield_here);

    HTH
  4. #3
  5. No Profile Picture
    razor
    Guest
    Devshed Newbie (0 - 499 posts)
    i use php to access the DB with. this is the query:
    "SELECT header, description, id FROM sourcecode where header like '%".$q."%' OR description like '%".$q."%' OR header like '".$q."%' OR description like '".$q."%' OR header like '".$q."' OR description like '".$q."' order by time desc limit $start,$end"

    is there an easier way to do it?

    ------------------
    Regards:
    Christian Jørgensen
    http://wiktor.dk/~razor/
    http://www.freecounter.f2s.com

Similar Threads

  1. Errcode:13 . How to solve it on MySQL + Windows 2000
    By hankycheng in forum MySQL Help
    Replies: 28
    Last Post: August 3rd, 2003, 10:05 AM
  2. Replies: 3
    Last Post: July 10th, 2003, 07:47 PM
  3. Replies: 4
    Last Post: December 27th, 2002, 01:22 AM
  4. Aborting a MySQL command
    By Dave_L in forum MySQL Help
    Replies: 2
    Last Post: April 30th, 2002, 04:30 PM
  5. MySQL UPDATE command and PHP
    By scream in forum PHP Development
    Replies: 2
    Last Post: July 7th, 2000, 11:31 PM

IMN logo majestic logo threadwatch logo seochat tools logo