Dear Friends,

I want to know that how can we compare two hebrew string in MySQL database?

I tried and search a lot on net but still could not found the answer.

My website is dealing with Hebrew(main) and English as well.

So please let me know How can I compare these two languages in SQL queries.
Because this problem is became headech for me now. My client is becoming engry and engry and engry..... on me.

Is there any solution for this?

Please help me out.

I am waiting for your reply. Please do it fast as soon as possible.

Thank you in advance.

Joshisumitnet

Maybe your client gets angry because you promised too much?
Are your tables encoded in UTF? Please submit the table design, some test data and a query which should work but does not.

CREATE TABLE IF NOT EXISTS `tblstuff` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'P.K.',
`MemberID` bigint(20) NOT NULL COMMENT 'F.K. Member Table',
`Title` varbinary(255) NOT NULL,
`CategoryID` bigint(20) NOT NULL COMMENT 'F.K. Category Table',
`TagID` bigint(20) DEFAULT NULL COMMENT 'F.K. Tag Table',
`Rate` int(3) DEFAULT NULL,
`Views` bigint(20) DEFAULT NULL,
`Status` enum('A','I','D','L') NOT NULL,
`HomePageStatus` enum('D','N') NOT NULL,
`CreatedDate` date NOT NULL,
PRIMARY KEY (`id`),
KEY `TagID` (`TagID`),
KEY `CategoryID` (`CategoryID`),
KEY `MemberID` (`MemberID`)
) ENGINE=InnoDB DEFAULT CHARSET=binary ROW_FORMAT=DYNAMIC AUTO_INCREMENT=136 ;

my query is
select Title from tblStuff where upper(convert(Title using latin1)) like '" . addslashes(strtoupper($keyword)) . "%' limit 0,20

I have two languages at one go.Means either Hebrew or English.

Then what to do?
Or let me say that only want Hebrew then what is solutions?
Thanks

Dear Friends,

Please look at this query...

Select mytext from tblhebrew where mytext='שאלות נפוצות'

When I run this query directly in phpMyAdmin then it's working perfectly.
But when I run same query using php script then it does not working.
Why?
Please see this is my php script code...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="he" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Home Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <body>
<?php
$link=  mysql_connect("localhost","root","");
mysql_select_db("dbhebrew");
//mysql_query("insert into tblhebrew (test,description) values ('עדיין לא רשום ? הרשם עכשיו ','עדיין לא רשום ? הרשם עכשיו ')");
$txt="שאלות נפוצות";
$query="Select mytext from tblhebrew where mytext='".mysql_real_escape_string($txt)."'";
echo $query;
$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_assoc($result);

echo "output:".$row['mytext'];
?>
    </body>
</html>

Thanks in advance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.