#15771 [Asn->Fbk]: COM: cannot pass value to image field by ado

From: Date: Mon, 20 Sep 2004 10:36:18 +0000
Subject: #15771 [Asn->Fbk]: COM: cannot pass value to image field by ado
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66443@lists.php.net to get a copy of this message
ID: 15771 Updated by: wez@php.net Reported By: darkwings at 263 dot net -Status: Assigned +Status: Feedback Bug Type: Feature/Change Request Operating System: windows PHP Version: 5CVS Assigned To: wez New Comment: please try PHP 5.0.1 and let us know if this works Previous Comments: ------------------------------------------------------------------------ [2003-11-17 22:36:40] sniper@php.net Wez, please check this one out. ------------------------------------------------------------------------ [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] phanto@php.net 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

« previous php.bugs (#66443) next »