Gossamer Forum
Home : General : Databases and SQL :

mySQL Query

Quote Reply
mySQL Query
Here is the situation:

1. User enters 'Română' ($cat) to search for this subcat in DMOZ database.
2. However, 'Română' is encoded as 'Română' in database (as it is by default in DMOZ dump).
3. Tried the following code, but fails:

my $str = "SELECT `catid` FROM `dstructure` WHERE UCASE(name) = UCASE(CONVERT( _utf8 '$cat' USING latin1 ))";
my $sth = $dbh->prepare($str);
$sth->execute();
$catid = $sth->fetchrow_array();

Ideas? Tried various encoding of input, but no luck. Try another encoding method of dstructure.name?

----
Cheers,

Dan
Founder and CEO

LionsGate Creative
GoodPassRobot
Magelln
Subject Author Views Date
Thread mySQL Query dan 14918 Sep 4, 2008, 11:16 AM
Thread Re: [dan] mySQL Query
tandat 14658 Sep 8, 2008, 6:52 AM
Thread Re: [tandat] mySQL Query
dan 14603 Sep 8, 2008, 2:01 PM
Thread Re: [dan] mySQL Query
brewt 14572 Sep 8, 2008, 10:14 PM
Thread Re: [brewt] mySQL Query
dan 14590 Sep 8, 2008, 10:51 PM
Thread Re: [dan] mySQL Query
brewt 14614 Sep 8, 2008, 11:36 PM
Post Re: [brewt] mySQL Query
dan 14482 Sep 9, 2008, 1:25 AM