Professional Web Applications Themes

LCASE() not working on columns. - MySQL

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 | ...

  1. #1

    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.

    Daz Guest

  2. #2

    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?

    Cheers.

    Daz.

    Daz Guest

  3. #3

    Default Re: LCASE() not working on columns.


    Daz wrote: 

    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.

    Daz Guest

Similar Threads

  1. #38816 [Opn]: PHP code that was working perfectly recently stopped working.
    By mtoohee at gmail dot com in forum PHP Programming
    Replies: 0
    Last Post: September 13th, 09:41 PM
  2. Replies: 0
    Last Post: November 26th, 06:47 AM
  3. Data not working on Label but is working in Datagrid
    By KetanS in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: June 11th, 03:56 AM
  4. Columns and Inherited Datagrid...Active Schema does not support columns
    By rob thomson in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: September 4th, 03:09 PM
  5. Replies: 0
    Last Post: July 2nd, 06:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139