Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot, bind-address mysql multiple, sanibleone xxxx, ftp://192.168.100.100/, www.xxxcon

Links

XODOX
Impressum

#1: Capitalization in PHP

Posted on 2008-04-16 02:34:22 by Matt White

Hello all,

I'm trying to build a site that searches through a MySQL database of songs.
I need to be able to take user input, and narrow the song list down.
However, if a user types in "C", but the song starts with "c", they will not
the song. Is there anyway to make MySQL ignore capitalization in a request?
I would like to find a way around having to de-capitalize all the songs in
the database, which is my only option right now. Any help would be
appreciated.

Matt White

Report this message

#2: Re: Capitalization in PHP

Posted on 2008-04-16 04:31:31 by Preventer of Work

Matthew White wrote:
> Hello all,
>
> I'm trying to build a site that searches through a MySQL database of
> songs. I need to be able to take user input, and narrow the song list
> down. However, if a user types in "C", but the song starts with "c",
> they will not the song. Is there anyway to make MySQL ignore
> capitalization in a request? I would like to find a way around having to
> de-capitalize all the songs in the database, which is my only option
> right now. Any help would be appreciated.
>
> Matt White

Mysql searches are no case sensitive. Looking for joE find Joe, joe and JOE.

See the old docs at
http://dev.mysql.com/doc/refman/4.1/en/case-sensitivity.html
or 5.1 docs:
http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html

Report this message

#3: Re: Capitalization in PHP

Posted on 2008-04-16 21:10:22 by Matt White

I am using a binary coalition that means that my queries are case sensitive.
Any way of getting around that?


"Preventer of Work" <not_this@nospam.xxx> wrote in message
news:7ydNj.54107$Cj7.22755@pd7urf2no...
> Matthew White wrote:
>> Hello all,
>>
>> I'm trying to build a site that searches through a MySQL database of
>> songs. I need to be able to take user input, and narrow the song list
>> down. However, if a user types in "C", but the song starts with "c", they
>> will not the song. Is there anyway to make MySQL ignore capitalization
>> in a request? I would like to find a way around having to de-capitalize
>> all the songs in the database, which is my only option right now. Any
>> help would be appreciated.
>>
>> Matt White
>
> Mysql searches are no case sensitive. Looking for joE find Joe, joe and
> JOE.
>
> See the old docs at
> http://dev.mysql.com/doc/refman/4.1/en/case-sensitivity.html
> or 5.1 docs:
> http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html
>

Report this message

#4: Re: Capitalization in PHP

Posted on 2008-04-17 02:01:06 by Preventer of Work

Matthew White wrote:
> I am using a binary coalition that means that my queries are case
> sensitive. Any way of getting around that?
>
>
> "Preventer of Work" <not_this@nospam.xxx> wrote in message
> news:7ydNj.54107$Cj7.22755@pd7urf2no...
>> Matthew White wrote:
>>> Hello all,
>>>
>>> I'm trying to build a site that searches through a MySQL database of
>>> songs. I need to be able to take user input, and narrow the song list
>>> down. However, if a user types in "C", but the song starts with "c",
>>> they will not the song. Is there anyway to make MySQL ignore
>>> capitalization in a request? I would like to find a way around having
>>> to de-capitalize all the songs in the database, which is my only
>>> option right now. Any help would be appreciated.
>>>
>>> Matt White
>>
>> Mysql searches are no case sensitive. Looking for joE find Joe, joe
>> and JOE.
>>
>> See the old docs at
>> http://dev.mysql.com/doc/refman/4.1/en/case-sensitivity.html
>> or 5.1 docs:
>> http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html
>>

You can generate a string to drive a regular expression. It's a bit of
work, but not too much. Here's the idea:

mysql> select * from incase where name = 'joe';
+----+------+
| id | name |
+----+------+
| 1 | joe |
+----+------+


mysql> select * from incase where name REGEXP '[Jj]oe';
+----+------+
| id | name |
+----+------+
| 1 | joe |
| 2 | Joe |
+----+------+

You would take the search string and just generate char pairs in
brackets, so

'Joe' becomes '[Jj][Oo][Ee]'

However, this is easier:

mysql> select * from incase where LOWER(name) = 'joe';
+----+------+
| id | name |
+----+------+
| 1 | joe |
| 2 | Joe |
+----+------+

Report this message

#5: Re: Capitalization in PHP

Posted on 2008-04-17 02:02:03 by Preventer of Work

Preventer of Work wrote:
> Matthew White wrote:
>> I am using a binary coalition that means that my queries are case
>> sensitive. Any way of getting around that?
>>
>>
>> "Preventer of Work" <not_this@nospam.xxx> wrote in message
>> news:7ydNj.54107$Cj7.22755@pd7urf2no...
>>> Matthew White wrote:
>>>> Hello all,
>>>>
>>>> I'm trying to build a site that searches through a MySQL database of
>>>> songs. I need to be able to take user input, and narrow the song
>>>> list down. However, if a user types in "C", but the song starts with
>>>> "c", they will not the song. Is there anyway to make MySQL ignore
>>>> capitalization in a request? I would like to find a way around
>>>> having to de-capitalize all the songs in the database, which is my
>>>> only option right now. Any help would be appreciated.
>>>>
>>>> Matt White
>>>
>>> Mysql searches are no case sensitive. Looking for joE find Joe, joe
>>> and JOE.
>>>
>>> See the old docs at
>>> http://dev.mysql.com/doc/refman/4.1/en/case-sensitivity.html
>>> or 5.1 docs:
>>> http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html
>>>
>
> You can generate a string to drive a regular expression. It's a bit of
> work, but not too much. Here's the idea:
>
> mysql> select * from incase where name = 'joe';
> +----+------+
> | id | name |
> +----+------+
> | 1 | joe |
> +----+------+
>
>
> mysql> select * from incase where name REGEXP '[Jj]oe';
> +----+------+
> | id | name |
> +----+------+
> | 1 | joe |
> | 2 | Joe |
> +----+------+
>
> You would take the search string and just generate char pairs in
> brackets, so
>
> 'Joe' becomes '[Jj][Oo][Ee]'
>
> However, this is easier:
>
> mysql> select * from incase where LOWER(name) = 'joe';
> +----+------+
> | id | name |
> +----+------+
> | 1 | joe |
> | 2 | Joe |
> +----+------+
>
>
Ooops, LOWER() both arguments

Report this message

#6: Re: Capitalization in PHP

Posted on 2008-04-19 02:07:24 by Matt White

OK, that works. Thanks for the help!

"Preventer of Work" <not_this@nospam.xxx> wrote in message
news:%rwNj.194759$pM4.105280@pd7urf1no...
> Preventer of Work wrote:
>> Matthew White wrote:
>>> I am using a binary coalition that means that my queries are case
>>> sensitive. Any way of getting around that?
>>>
>>>
>>> "Preventer of Work" <not_this@nospam.xxx> wrote in message
>>> news:7ydNj.54107$Cj7.22755@pd7urf2no...
>>>> Matthew White wrote:
>>>>> Hello all,
>>>>>
>>>>> I'm trying to build a site that searches through a MySQL database of
>>>>> songs. I need to be able to take user input, and narrow the song list
>>>>> down. However, if a user types in "C", but the song starts with "c",
>>>>> they will not the song. Is there anyway to make MySQL ignore
>>>>> capitalization in a request? I would like to find a way around having
>>>>> to de-capitalize all the songs in the database, which is my only
>>>>> option right now. Any help would be appreciated.
>>>>>
>>>>> Matt White
>>>>
>>>> Mysql searches are no case sensitive. Looking for joE find Joe, joe and
>>>> JOE.
>>>>
>>>> See the old docs at
>>>> http://dev.mysql.com/doc/refman/4.1/en/case-sensitivity.html
>>>> or 5.1 docs:
>>>> http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html
>>>>
>>
>> You can generate a string to drive a regular expression. It's a bit of
>> work, but not too much. Here's the idea:
>>
>> mysql> select * from incase where name = 'joe';
>> +----+------+
>> | id | name |
>> +----+------+
>> | 1 | joe |
>> +----+------+
>>
>>
>> mysql> select * from incase where name REGEXP '[Jj]oe';
>> +----+------+
>> | id | name |
>> +----+------+
>> | 1 | joe |
>> | 2 | Joe |
>> +----+------+
>>
>> You would take the search string and just generate char pairs in
>> brackets, so
>>
>> 'Joe' becomes '[Jj][Oo][Ee]'
>>
>> However, this is easier:
>>
>> mysql> select * from incase where LOWER(name) = 'joe';
>> +----+------+
>> | id | name |
>> +----+------+
>> | 1 | joe |
>> | 2 | Joe |
>> +----+------+
>>
>>
> Ooops, LOWER() both arguments

Report this message

#7: Re: Capitalization in PHP

Posted on 2008-04-21 19:58:30 by unknown

Post removed (X-No-Archive: yes)

Report this message