|
Posted by Jerry Stuckle on 07/19/07 04:30
eisenstein wrote:
> On 17 Jul., 15:24, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> eisenstein wrote:
>>> On 17 Jul., 09:42, Toby A Inkster <usenet200...@tobyinkster.co.uk>
>>> wrote:
>>>> eisenstein wrote:
>>>>> i read out an utf-8 xml file with greek or russian/cyrillic
>>>>> characters. i can display it in the browser but if i insert data into
>>>>> an mssql database -field is nvarchar(4000)- i only see ??? or
>>>>> incorrect characters.
>>>> This doesn't seem to be a PHP question. Try one of the microsoft.* groups.
>>>> --
>>>> Toby A Inkster BSc (Hons) ARCS
>>>> [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
>>>> [OS: Linux 2.6.12-12mdksmp, up 26 days, 11:22.]
>>>> demiblog 0.2.0 Released
>>>> http://tobyinkster.co.uk/blog/2007/06/28/demiblog-0.2.0/
>>> this is a php question: i use php with ms sql server and use php
>>> functions to connect to the ms sql server
>> That doesn't mean it's a php question.
>>
>> You use HTML also - it could be an HTML question. You use mssql - it
>> could be an mssql question. You use Apache or IIS - it could be an
>> Apache or IIS question....
>>
>> I'll bet you even use a keyboard and mouse. Hey, it could be a keyboard
>> or mouse question!
>>
>> The point is - just because you use PHP doesn't mean it's a PHP
>> question. And in this case it isn't. There are a lot of other
>> possibilities. You need to further determine exactly where the problem
>> is.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> - Configuration IIS, PHP 5 and MS SQL SERVER 2000
> - There's the possibility of uploading XML-Documents (UTF-8)
> - A PHP-application reads some values, some of it has cyrillic
> characters
> - Showing the Characters in the Browser is no problem, but some of the
> data should be insertet into an MS SQL Database (The datatype of the
> fields are nvarchar):
> This process does not work, whatever I use I just get wrong
> characters. If I manually copy chars from the XML-File and paste it
> into the database it displays it in the table.
>
> If I test the same thing with MySQL (and SET NAME UTF-8) everything
> works fine.
>
> To connect to the MS-SQL Server I used MS-SQL Functions, tried ZEND DB
> Adapter and also Pear AdoDB Connection. I always get the same results.
> I tried to convert the strings from UTF-8 to UCS-2, but then all
> Inserts are terminated.
>
> $xmldata = ' ';
> //$data = mb_convert_encoding($xmldata, "UCS-2", "UTF-8");
>
> // Example using ADODB Connection
> require_once 'adodb/adodb.inc.php';
> $db =& ADONewConnection('odbc_mssql');
> $dsn = "DRIVER={SQL Server};Server=localhost;Database=test";
> $db->Connect($dsn, $username, $pwd);
> $db->Execute("INSERT INTO test (test2) VALUES ('$data')");
>
Sounds like you need to be looking for help in an MS SQL database newsgroup.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|