Bluehost.com Web Hosting $6.95

Searching Encoded Data With Special Letters

This is a discussion on Searching Encoded Data With Special Letters within the MySQL Database forums, part of the Database Forums category; Hi, I am using a MySql database, and data is stored in longtext columns, encrypted (With encode()). There are some ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-01-2007
ist
 
Posts: n/a
Default Searching Encoded Data With Special Letters

Hi,
I am using a MySql database, and data is stored in longtext columns,
encrypted (With encode()).
There are some Turkish characters in data, and they are displayed
perfectly after data is decoded. However, I am not able to search
these special letters in data:

- Suppose there is the word "İstanbul" in a field named City
(First letter is a special letter; caps i with dot - not I)

- When I search data with:

select decode(City,'decodestring') from Cities where
decode(City,'decodestring') like '%stanbul%'

query, my data returns fine since there is no special characters in my
like comparison string.

- However, when I use '%İstanbul%' instead of '%stanbul%', since there
is a special letter, no rows are returned.

I've tried different Character sets and collation properties but could
not find a solution. As I've said I have NO problem with displaying
the data, only searching.

Thanks..

Reply With Quote
  #2 (permalink)  
Old 06-01-2007
lark
 
Posts: n/a
Default Re: Searching Encoded Data With Special Letters

== Quote from ist (saygin@gmail.com)'s article
> Hi,
> I am using a MySql database, and data is stored in longtext columns,
> encrypted (With encode()).
> There are some Turkish characters in data, and they are displayed
> perfectly after data is decoded. However, I am not able to search
> these special letters in data:
> - Suppose there is the word "İstanbul" in a field named City
> (First letter is a special letter; caps i with dot - not I)
> - When I search data with:
> select decode(City,'decodestring') from Cities where
> decode(City,'decodestring') like '%stanbul%'
> query, my data returns fine since there is no special characters in my
> like comparison string.
> - However, when I use '%İstanbul%' instead of '%stanbul%', since there
> is a special letter, no rows are returned.
> I've tried different Character sets and collation properties but could
> not find a solution. As I've said I have NO problem with displaying
> the data, only searching.
> Thanks..


can you send the output of this command to the group:

show create table tablename;

tablename of course refers to the Cities table. this will tell me what charset and
collation you're using on the table.


--
POST BY: lark with PHP News Reader
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:19 AM.


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