473,763 Members | 6,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP+MSSQL

Hi frenz

Lately I try to use MSSQL and PHP , the problem arise when PHP try to
read MSSQL field with 'image' data type,

header("Content-type: image/jpeg"); // act as a jpg file to browser

I try to used normal working file that store BLOB as file type in MSSQL
...but still not working. Is it because the image data type in MSSQL can
not be recognise by PHP?
Any one can give the hint.. thanks u in advance.

Jul 17 '05
11 4394
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("databa seAccess.php");
$Link = odbc_connect($D SN, $User, $Password);

$SqlQuery = "SELECT * FROM uml WHERE ID=".$_GET["iid"];
$QueryResult = odbc_do ($Link, $SqlQuery);

if (odbc_num_rows( $QueryResult)>0 )
{
$Row = @odbc_fetch_arr ay ($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.


Jul 17 '05 #11
I think this ancient problem..
since no one come with the answer...
I had serach for the answer.. for quite long time....
any one can help???

Jul 17 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4520
by: marty | last post by:
I have a webpage that displays data from a SQL database in table format. I found information on how to create a way to allow a user to download this information to Excel using 'Header()' in the PHP code. Header("Content-Type: application/vnd.ms-excel"); Header("Content-Disposition: attachment; filename=\"filename.xls\""); I setup a link on the display page that sends the variables needed for the SQL query to a different PHP page and...
7
23874
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that tracks jobs for me, and we
0
2215
by: dan | last post by:
Hi, I connect to a microsoft SQL server from php. Php is running on linux (debian sarge) with the freetds package. The connection is secured through stunnel (version 3.26), with stunnel running locally on the web server and locally on the SQL server machine. This means php connects locally to the stunnel port, which then establishes a secure connection to stunnel on the sql server. There the data is then transmitted locally to the SQL...
7
3205
by: Mark Knochen | last post by:
Hallo, i have a MS SQL Database with some tables with textfields. in the textfields are long strings ... but i cant get the full string from the table ... i get only ca. 8000 chars ... Mark
1
11556
by: Filipe Tomita | last post by:
Hi all, I have tried connect to remote MS SQL server with no success. Anyone help me? ###this is the code used to try connect $dsn = "Driver={SQL Server};Server=200.xxx.xxx.xxx;Database=Mydb;"; $user = 'WebService'; $pass = 'triad';
5
14599
by: cecep | last post by:
hei, anyone! i need help to paging php using mssql, and php script in the program to make a next and previous button.. please sending message for me if you can answer my question
4
2806
by: sheckel | last post by:
I am running PHP on one server (IIS), trying to connect to SQL Server on another server (all in-house, none available off campus). SQL Server Client has been loaded onto the box running PHP. My script stops at the mssql_connection() function, apparently not connecting to the other server. I've started working with the folks over at php.net, but I would appreciate any help I can get from anyone.
0
1768
by: hassanali20 | last post by:
I've surfed this forum and found one thread which was talking about the same problem i've, but it didn't help in my situation. http://www.thescripts.com/forum/thread510563.html I could connect to MSSQL server using freetds 8.0 and able to run queries to MSSQL server, but the query doesn't fetch anything when it runs on a column having datatype as VARCHAR having special character as in <méxico> (note the second character) the acute accent. ...
6
4755
by: SalokinX | last post by:
Hi everyone. I am trying to make a table that when people edit something from it, it will show the date it was edited. This is my code: $date = date("m/d/Y"); mssql_query("INSERT INTO news2 (title, dtime, text1, text2) VALUES ('$title', $date, '$text1', '$text2')"); The thing is that when I check the table, the time is messed up. It shows 4/11/1900 instead of 01/20/2008.
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.