Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2005, 10:44 AM
Authorized User
 
Join Date: Feb 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in reading imge from sqlserver

problem in reading imge from sqlserver
my code is:
<?php
include('conect.php');
$query="SELECT file_name, file_size, file_code, file_type, file_des
FROM graph";
$reult=mssql_query($query,$link);
while($row=mssql_fetch_array($reult))
{
$fp=fopen($row['file_name'],"wb");
$file=fwrite($fp,$row['file_code']);
print"<img src=\"".$row['file_code']."\">";
}
?>
 
Old February 7th, 2005, 12:45 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Though I am not an expert in PHP (decent way of saying that I haven't worked on that :) ) ... I guess one can't retreive fields in an arbitary fachion when it comes to fields of Image/Text datatypes. If my memory is right i think image/text datatype columns needs to be at the end of the selection list.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old February 7th, 2005, 12:58 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

Yes, Vadivel you are correct. The fields of binary type has to be at the end of the fields list used in select statement.

In order to make them fast, I usually fetch binary fields in a seperate stored procedure. You may try that also.





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem when reading from database al-hijjawi Visual Basic 2005 Basics 0 August 2nd, 2007 01:26 AM
SQLserver 2000 vs SQLserver 2005 Express cJeffreywang BOOK: Beginning ASP.NET 2.0 and Databases 0 April 22nd, 2007 09:52 AM
[Problem] Remote SQLServer CE ahan C# 0 October 7th, 2004 10:17 PM
document reading problem syedusman1 Classic ASP Databases 0 March 30th, 2004 01:45 AM
problem with asp+sqlserver thiagoserra Classic ASP Databases 0 July 11th, 2003 10:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.