|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I use LIKE in case insensitive ?
------------------ Regards: Christian Jørgensen http://wiktor.dk/~razor/ http://www.freecounter.f2s.com |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > The MySQL 'LIKE' command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|