ID:               15771
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Suspended
 Bug Type:         COM related
 Operating System: windows
 PHP Version:      4.0.6
 New Comment:

hmm, this is a bit difficult because strings become usually translated
into unicode which is usually a good thing(tm) but unfortunatelly not
in this case.
as i'm actually rewriting the whole thing for php5/ZE2 i don't think
that i'll address this yet.

harald

ps: don't use ado, it's sloooooooooooow :)


Previous Comments:
------------------------------------------------------------------------

[2002-02-27 21:29:09] [EMAIL PROTECTED]

Since PHP can support COM and I usually use php in windows,
I try to use database like mssql through ado.
All things work properly but the image datatype of mysql cannot be set 
correctly.
I use it just like this
<?
$dbconn=new COM("ADODB.Connection") or die ("connection create fail");
$dbconn->Open("Provider=sqloledb;Data Source=ndht;Initial
Catalog=printers;User Id=printers;Password=printers;");
$fp=fopen("5.gif","r") or die ("file opening error");
$content = fread ($fp, filesize ("5.gif"));
fclose ($fp);
echo filesize ("5.gif");
$rec=new COM("ADODB.recordset");
$rec->open("select * from sav",$dbconn);
$rec->addnew();
$rec->fields["datas"]->AppendChunk($content);
$rec->update();
$rec->close();
$rec=null;
$dbconn->close();
$dbconn=null;
?>

I think that windows use two type text for strings and binary for the
8bit chars, but in php string are both of
these.
So when trans the data to mssql,the variables be string of
window first, and the information were lost.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15771&edit=1

Reply via email to