From:             [EMAIL PROTECTED]
Operating system: windows
PHP version:      4.0.6
PHP Bug Type:     COM related
Bug description:  cannot pass value to image field by ado

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 bug report at http://bugs.php.net/?id=15771&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15771&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15771&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15771&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15771&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15771&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15771&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15771&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=15771&r=submittedtwice

Reply via email to