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.
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?
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.
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">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
//mysql_query("insert into tblhebrew (test,description) values ('עדיין לא רשום ? הרשם עכשיו ','עדיין לא רשום ? הרשם עכשיו ')");
$query="Select mytext from tblhebrew where mytext='".mysql_real_escape_string($txt)."'";
$result=mysql_query($query) or die(mysql_error());
Thanks in advance.
If phpMyAdmin does deliver correct results and your PHP query does not, this is most likely due to the fact that phpMyAdmin issues the correct character set statements. You php script seems to use the wrong character sets.
Have a look at http://dev.mysql.com/doc/refman/5.1/de/charset-connection.html