|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-05-13 18:50 UTC] kalowsky@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
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; ?>