[workaround] php-3/freetds/mssql 6.5 BLOB TEXT an BINARY

Franck Martin Franck at sopac.org.fj
Mon May 8 17:42:03 EDT 2000


I don't know which fault is it freetds or php, but a BLOB of type TEXT
cannot be retreived in its total length...

Therefore you extract it by chuncks of 255 character or less with the
command 

$i=1;
$result2=sybase_query("select SUBSTRING(Contents,1,200) as subcontents from
[*****] Where PRID=".$PRID,$conn);
$arr_row2=sybase_fetch_row($result2);
While ($arr_row2[0]!="") 
{
	echo(nl2br($arr_row2[0]));
	$ok=sybase_free_result($result2);
	$i+=200;
	$result2=sybase_query("select SUBSTRING(Contents,$i,200) as
subcontents from [*****] Where PRID=".$PRID,$conn);
	$arr_row2=sybase_fetch_row($result2);

}

I'm trying to do the same thing with binary BLOB (JPEG image), but it does
not work (crash?). I don't know if it is because php cannot handle binary
data, but only strings or float or if i

Anybody has an idea on the subject ?


Franck Martin
Network and Database Development Officer
SOPAC South Pacific Applied Geoscience Commission
Fiji
E-mail: franck at sopac.org.fj <mailto:franck at sopac.org.fj> 
Web site: www.sopac.org.fj <http://www.sopac.org.fj> 




More information about the FreeTDS mailing list