MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 19th, 1999, 01:05 PM
razor
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How do I use LIKE in case insensitive ?

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

Reply With Quote
  #2  
Old October 19th, 1999, 01:16 PM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #3  
Old October 19th, 1999, 04:03 PM
razor
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > The MySQL 'LIKE' command


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT