473,748 Members | 2,294 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 #1
11 4390
If I understand you correctly, you put the image itself into the database?
Why ?
better is to put the link in the database and the image itself in the map in
the link is mutch better.

"badz" <ba****@gmail.c om> schreef in bericht
news:11******** *************@z 14g2000cwz.goog legroups.com...
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 #2
On Mon, 29 Nov 2004 00:24:24 +0100, "Polaris"
<as*********@ho tmail.com> wrote:

Stop top posting.
If I understand you correctly, you put the image itself into the database?
Why ?
better is to put the link in the database and the image itself in the map in
the link is mutch better.
If you're saying put the image on a filesystem instead of in a
database, then you're missing rhe point of using a database.


"badz" <ba****@gmail.c om> schreef in bericht
news:11******* **************@ z14g2000cwz.goo glegroups.com.. .
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.


--
gburnore@databa six dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
=============== =============== =============== =============== ===============
Want one? GET one! http://signup.databasix.com
=============== =============== =============== =============== ===============
Jul 17 '05 #3
what I means is I tried to pull the image from MSSQL database which
used image as their data type not BLOB..
is it the reason I can not pull the image..
by the way the MSSQL table that I used is "view table"

Jul 17 '05 #4
?
Why ?
better is to put the link in the database and the image itself in the map inthe link is mutch better.


If you're saying put the image on a filesystem instead of in a
database, then you're missing rhe point of using a database.


Or perhaps you are missing the point of simplicity and speed and
reliability.

Horses for courses. If it is something sensitive, yes storing in a database
is a reasonable solution.

If it is not sensitive at all, one must have the MS bug to do something like
that...

Regards,

Tom
Jul 17 '05 #5
On Mon, 29 Nov 2004 22:42:31 +1000, "Tom Szabo" <to*@intersoft. net.au>
wrote:
?
>Why ?
>better is to put the link in the database and the image itself in the mapin >the link is mutch better.


If you're saying put the image on a filesystem instead of in a
database, then you're missing rhe point of using a database.


Or perhaps you are missing the point of simplicity and speed and
reliability.

Horses for courses. If it is something sensitive, yes storing in a database
is a reasonable solution.

If it is not sensitive at all, one must have the MS bug to do something like
that...


You don't know much about databases, eh?

A well written program with a well designed database can deliver your
miages quite quickly. Depending on the database, it can be twice as
fast or only somewhat faster. It's seldom slower than having
thousands of files in a directory for a program to search through.

It also has nothing to do with Microsoft.

Now if you could just learn how to attribute correctly, you'd have the
medium of USENet to list among things you know how to do.
--
gburnore@databa six dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
=============== =============== =============== =============== ===============
Want one? GET one! http://signup.databasix.com
=============== =============== =============== =============== ===============
Jul 17 '05 #6
> You don't know much about databases, eh?

A well written program with a well designed database can deliver your
miages quite quickly. Depending on the database, it can be twice as
fast or only somewhat faster. It's seldom slower than having
thousands of files in a directory for a program to search through.

It also has nothing to do with Microsoft.

Now if you could just learn how to attribute correctly, you'd have the
medium of USENet to list among things you know how to do.

Well I may not know much about them, but at least have 10 years of
experience and currently working on one similiar project and have one
program running for 3 years without a hickup with a few 100K pictures (0.5
TByte on Raid 5 controller). Well, I may not be doing things the way MS and
other "Authoritie s" suggest, but I usually end up with rock solid
solutions...

....my programs don't utilise the Registry, but they can be easily installed,
don't screw up, and have never done one machine, and one can run multiple
copies of it at the same time, if for same strange reason one needs to. One
may also run older versions of the same thing simultaneously. ..etc

This is not because of my higher IQ or because I am a smarter programmer. I
think it is simply because I don't overcomplicate things when it is not
needed...

I beleive in simple and elegant solutions, simple straight logic.

I still think, horses for courses! I like to see how will you deliver a
number of pictures from a database significantly quicker through an SQL
server than straight from a well organised Hierachical File Structure, which
gets pretty close to optimal binary search....

considering that you have to read the data from a hard-drive into say an SQL
server, than feed it to IIS

opposed to sending a link to the browser and IIS sends the files
down....also I am curious which will be more processor hungry?

And I agree with you on that a lot depend on the iumplementation :-)

Regards,

Tom

Jul 17 '05 #7

"badz" <ba****@gmail.c om> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
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.


I use MSSQL in my project and manage to store/retrieve images from the
database with no problem. Here's what I suggest:

Check mssql.textsize in php.ini. If I remember correctly it affect blob as
well text type. Alternatively you could get the pointer to the blob and
retrieve the data a small chunk at a time using readtext.

Check the routine that stores the images. Maybe the image never made it into
the database in the first place. I can't remember what it is exactly but
there's a limit to how long a SQL statement can be in MSSQL.
Jul 17 '05 #8
Hi frenz

first the image is put inside the db because of the user want it kept
the information inside the db not in specific folder or dir. Off course
there have issue on this, but the image file is not so big.

I had increase the file size in php.ini but the image seems not appear
at all.
I had use asp script and its able to display the image correctly, it
prove that there is no problem occur while inserting the image.

any one can share part of the code in retrieiving the image..
again the image is not 'BLOB data type' but MSSQL special 'image data
type'

Jul 17 '05 #9

"badz" <ba****@gmail.c om> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi frenz

first the image is put inside the db because of the user want it kept
the information inside the db not in specific folder or dir. Off course
there have issue on this, but the image file is not so big.

I had increase the file size in php.ini but the image seems not appear
at all.
I had use asp script and its able to display the image correctly, it
prove that there is no problem occur while inserting the image.

any one can share part of the code in retrieiving the image..
again the image is not 'BLOB data type' but MSSQL special 'image data
type'


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 #10

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

Similar topics

1
4518
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
23872
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
2213
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
3201
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
11554
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
14597
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
2804
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
1767
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
4754
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
8822
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9528
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...
0
9359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9310
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
6072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4592
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3298
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
2
2774
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.