Bug #13133 Updated: Get longbinary data from ACCESS
| From: | kalowsky@php.net | Date: | Mon, 13 May 2002 22:50:03 +0000 |
| Subject: | Bug #13133 Updated: Get longbinary data from ACCESS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7575@lists.php.net to get a copy of this message | ||
ID: 13133
Updated by: kalowsky@php.net
Reported By: rossati@libero.it
-Status: Open
+Status: Bogus
Bug Type: ODBC related
Operating System: W98 ME
PHP Version: 4.0.4pl1
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2001-09-04 11:08:25] rossati@libero.it
LongBinary data from ACCESS.
I receive 2 bytes for every byte of data, one is &h00.
<?php
$SceltaOggetto = "GIRASOLE";
$db=odbc_connect("CISTERNA","","");
$Where = "NCTN = '".$SceltaOggetto."'";
// cerco immagine ed eventualmente la scrivo
$SQL="SELECT IMMAGINE,DIMENSIONE FROM IMMAGINI WHERE ".$Where;
$resImg=odbc_exec($db,$SQL);
if (odbc_fetch_row ($resImg) == TRUE):
odbc_binmode ($resImg,ODBC_BINMODE_PASSTHRU);
$Dimensione = odbc_result($resImg,2); // ll immagine
echo "<BR>Dimensione: ".$Dimensione."<BR>";
$NomeFile = $SceltaOggetto.".jpg";
unlink($NomeFile); // scancello
if (file_exists($NomeFile) == FALSE):
odbc_longreadlen ($resImg,$Dimensione);
$graf = odbc_result($resImg,1);
echo "Lungore ".strlen($graf);
$fp = fopen ($NomeFile, "wb");
fwrite($fp,$graf,$Dimensione);
echo "<BR>ECHO<BR><BR>".$graf;
fclose($fp);
endif;
endif;
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=13133&edit=1