Search code examples
phpsql-server-2000hebrew

How can I insert Hebrew text into columns? [SQL 2000]


I tried to insert Hebrew a text value into a column, But it changes the value to Gibberish. An example of that:

mssql_query ("UPDATE TABLE SET COLUMON = N'בדיקה'");

As you can assume, It changes the value of the column, But the value changed to ????? and if I try to do it from Query Analyser it works fine.

My column's collation is HEBREW_CI_AS. How can I fix this?


Solution

  • I solve this problem if someone else has this problem here is my way to fix that:

    1. Create a new database for this specific table or else tables for your web.
    2. Set Hebrew_CI_AS as collation (everyone to what he created).
    3. In your PHP code use mb_convert_encoding() function for SELECT and INSERT.