Search code examples
sqlsql-serverunicodehebrewchars

Mssql query in hebrew fetchs nothing


I'm trying to fetch data from my DB.
It works great when there are no hebrew chars involved, but it doesn't work with hebrew chars.
Here's a query for example:

while (list($ddd, $ccc) = each($dbb)){
$dsn = "DRIVER={SQL Server}; SERVER={$ccc};UID={$usr};PWD={$pwd}; DATABASE={$ddd}";
$db->Open($dsn);
$SQL = "SELECT TOP 10 CardCode FROM dbo.OPDN WHERE Cast(CardCode AS Nvarchar(max)) = N'רונלייט'";
$rs = $db->Execute($SQL);
$qqqw='';
while(!$rs->EOF){
    echo ($rs->Fields['CardCode']);
    echo "<br />";
   $rs->MoveNext();
}
$rs->Close();
$db->Close();
}

Help would be highly appreciated.


Solution

  • Got it!
    Problem was with the file encoding.
    It should have been in "ASCI".