Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

how to get images from mysql database path
Welcome, Guest. Please login or register.
September 06, 2008, 08:18:50 PM
11293 Posts in 1245 Topics by 842 Members
Latest Member: nimdakiller
Experts Round Table Network  |  Serverside Technology  |  PHP  |  how to get images from mysql database path « previous next »
Pages: [1]
Author Topic: how to get images from mysql database path  (Read 212 times)
spotonukraj

Offline Offline

Posts: 5


« on: February 07, 2008, 03:05:52 PM »



 Hi,

 I m new to php. i designed form were this are the fields : Name, email, phone No. & photo.

 I uploaded this data to database as well, were for imagedata i just save the path in sql
table and image in folder called images on server.

when i fetching all data except image part all text data viewing properly, i m not able to get images the images place look like broken link on html page. I put that header as well

header content (content type images/jpeg) but it not working. I am looking for somone help me out.
Logged
rdivilbiss
Governing Council Member
*
Offline Offline

Posts: 414



WWW
« Reply #1 on: February 07, 2008, 05:36:47 PM »

Well it is certainly possible to load images into a database as binary objects but it is a complete waste of resources.

If you want the "how to" as a object lesson in what not to do we can provide that, but if you want efficiency, load the images natively to the file system and store only the path/filename in the database.

Easier to maintain and significantly faster, both in terms of development and maintenance, as well as server time to actually present the image to the browser.
Logged

Rod
CrYpTiC_MauleR
Site Builder

Offline Offline

Posts: 488



WWW
« Reply #2 on: February 07, 2008, 10:35:44 PM »

>> header content (content type images/jpeg)

are you putting it as this in your PHP file?

header('Content-Type: image/jpeg');

Remember must be put BEFORE any content is sent to browser, and the MIME type is image/jpeg not images/jpeg, see if that helps. By the way is the page accessible to us? If so can you post the link so we can visit it and see what could be happening in the request?
Logged

[x] Fight | www.crypticmauler.com
"You must be
Pages: [1]
« previous next »
    Jump to: