Bug #15771 Updated: cannot pass value to image field by ado

2002-03-12 Thread darkwings

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

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.


Previous Comments:


[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 slw :)



[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
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




Bug #15771 Updated: cannot pass value to image field by ado

2002-03-11 Thread phanto

 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 slw :)


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
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