LCASE() not working on columns.

This is a discussion on LCASE() not working on columns. within the MySQL Database forums, part of the Database Forums category; Hi everyone. I am trying to pull everything out of my table using LCASE() like so: SELECT LCASE(`URL`) FROM ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-30-2006
Daz
 
Posts: n/a
Default LCASE() not working on columns.

Hi everyone.

I am trying to pull everything out of my table using LCASE() like so:

SELECT LCASE(`URL`) FROM tags LIMIT 10;

However, it's not working as I get

+---------------------------------------------------------------------------------------------+
| LCASE(`url`)
|
+---------------------------------------------------------------------------------------------+
| ./home/daz/Desktop/Desktop/From Kaz/2Pac - Ghetto Gospel.mp3
|
| ./home/daz/Desktop/Desktop/From Kaz/Arrested Development - Everyday
People.mp3 |
| ./home/daz/Desktop/Desktop/From Kaz/Beats International - Dub Be Good
To Me.mp3 |
| ./home/daz/Desktop/Desktop/From Kaz/Brandy & Monica - The Boy Is
Mine.mp3 |
| ./home/daz/Desktop/Desktop/From Kaz/Judge Jules - Sandstorm (original
mix) - Darude.wma |
| ./home/daz/Desktop/Desktop/From Kaz/Kelly Clarkson - Behind These
Hazel Eyes.mp3 |
| ./home/daz/Desktop/Desktop/From Kaz/Kelly Clarkson - Miss
Independent.mp3 |
| ./home/daz/Desktop/Desktop/From Kaz/Kelly Roland - Stole.mp3
|
| ./home/daz/Desktop/Desktop/From Kaz/Len - Don't Steal My Sunshine.mp3
|
| ./home/daz/Desktop/Desktop/From Kaz/Liberty X Ft Run DMC - Song For
Lovers (CD Quality).mp3 |
+---------------------------------------------------------------------------------------------+

Is there something I am missing, or another alternative. Basically, I
need to use LIKE, but I would like to do everything in lowercase. So
rather than 'Dub Be Good To Me' matching only 'Dub Be Good To Me', I
want to use 'dub be good to me' and for it to match anything in the
database that's the same, regardless of the case.

I would appreciate any suggestions.

Many thanks.

Daz.

Reply With Quote
  #2 (permalink)  
Old 10-30-2006
Daz
 
Posts: n/a
Default Re: LCASE() not working on columns.


Daz wrote:
> Hi everyone.
>
> I am trying to pull everything out of my table using LCASE() like so:
>
> SELECT LCASE(`URL`) FROM tags LIMIT 10;
>
> However, it's not working as I get
>
> +---------------------------------------------------------------------------------------------+
> | LCASE(`url`)
> |
> +---------------------------------------------------------------------------------------------+
> | ./home/daz/Desktop/Desktop/From Kaz/2Pac - Ghetto Gospel.mp3
> |
> | ./home/daz/Desktop/Desktop/From Kaz/Arrested Development - Everyday
> People.mp3 |
> | ./home/daz/Desktop/Desktop/From Kaz/Beats International - Dub Be Good
> To Me.mp3 |
> | ./home/daz/Desktop/Desktop/From Kaz/Brandy & Monica - The Boy Is
> Mine.mp3 |
> | ./home/daz/Desktop/Desktop/From Kaz/Judge Jules - Sandstorm (original
> mix) - Darude.wma |
> | ./home/daz/Desktop/Desktop/From Kaz/Kelly Clarkson - Behind These
> Hazel Eyes.mp3 |
> | ./home/daz/Desktop/Desktop/From Kaz/Kelly Clarkson - Miss
> Independent.mp3 |
> | ./home/daz/Desktop/Desktop/From Kaz/Kelly Roland - Stole.mp3
> |
> | ./home/daz/Desktop/Desktop/From Kaz/Len - Don't Steal My Sunshine.mp3
> |
> | ./home/daz/Desktop/Desktop/From Kaz/Liberty X Ft Run DMC - Song For
> Lovers (CD Quality).mp3 |
> +---------------------------------------------------------------------------------------------+
>
> Is there something I am missing, or another alternative. Basically, I
> need to use LIKE, but I would like to do everything in lowercase. So
> rather than 'Dub Be Good To Me' matching only 'Dub Be Good To Me', I
> want to use 'dub be good to me' and for it to match anything in the
> database that's the same, regardless of the case.
>
> I would appreciate any suggestions.
>
> Many thanks.
>
> Daz.


Ok, I have just realised that the fields I am trying to use lower on
are varbinary(255) fields. Is there any alternative to LCASE() or
LOWER(), or should I just do all of this from within a PHP script?

Cheers.

Daz.

Reply With Quote
  #3 (permalink)  
Old 10-30-2006
Daz
 
Posts: n/a
Default Re: LCASE() not working on columns.


Daz wrote:
> Ok, I have just realised that the fields I am trying to use lower on
> are varbinary(255) fields. Is there any alternative to LCASE() or
> LOWER(), or should I just do all of this from within a PHP script?


It would appear that I have solved my own problem.

I just found that I can use CAST()... So SELECT LOWER(CAST(`url` AS
CHAR(255))) FROM tags LIMIT 10; works really well for me.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0