|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-11 13:04 UTC] phanto@php.net
[2002-03-12 06:15 UTC] darkwings at 263 dot net
[2003-11-17 22:36 UTC] sniper@php.net
[2004-09-20 12:36 UTC] wez@php.net
[2004-09-28 01:00 UTC] php-bugs at lists dot php dot net
[2006-06-18 14:40 UTC] okumurya at hotmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
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.