This is a discussion on PHP+MSSQL within the PHP Language forums, part of the PHP Programming Forums category; I am having the same problem with printing images via php from mssql. I am not able to print out ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am having the same problem with printing images via php from mssql.
I am not able to print out the image from the mssql database via php, but the other "text" data returns normally. Here's the part of the code that prints the image correctly via a php-mysql relationship but won't work correctly in php-mssql: <? include("databaseAccess.php"); $Link = odbc_connect($DSN, $User, $Password); $SqlQuery = "SELECT * FROM uml WHERE ID=".$_GET["iid"]; $QueryResult = odbc_do ($Link, $SqlQuery); if (odbc_num_rows($QueryResult)>0) { $Row = @odbc_fetch_array ($QueryResult); $image_type = $Row["Type"]; $image = $Row["Image"]; Header ("Content-type: $image_type"); print $image; } ?> Any help would be appreciated! Thanks! ?> > Image = Blob in Microsoft-speak. There's nothing special about it. Just a > blob of binary data. > > I don't know what you mean by 'file size in php.ini'. The settings that you > need to change are mssql.textsize and mssql.textlimit. > > Again, PHP has no problem dealing if blobs from MS SQLServer. All you have > to do is select the column. You might need to place the blob column last. > Other than that it doesn't behave differently from other columns. > > Post the actual code if you're still having problem. Kinda hard to guess at > what you're actually doing. |