ID: 15771 Updated by: [EMAIL PROTECTED] Reported By: darkwings at 263 dot net -Status: Suspended +Status: Assigned Bug Type: COM related Operating System: windows -PHP Version: 4.0.6 +PHP Version: 5CVS -Assigned To: +Assigned To: wez New Comment:
Wez, please check this one out. Previous Comments: ------------------------------------------------------------------------ [2002-03-12 06:15:05] darkwings at 263 dot net i think it is not necessary to rewrite,just use a function like binarywrite() in asp(Active Server Page), int binarywrite ($variant,$source) return the length copied. ------------------------------------------------------------------------ [2002-03-11 13:04:50] [EMAIL PROTECTED] 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 :) ------------------------------------------------------------------------ [2002-02-27 21:29:09] darkwings at 263 dot net 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