944,018 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 14954
  • PHP RSS
Oct 12th, 2004
0

uploading image in database

Expand Post »
I am new to PHP and don't know how to upload a picture in database and after uploading how to display it.

Plz help me if u know.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sunil kumar bob is offline Offline
1 posts
since Oct 2004
Oct 13th, 2004
0

Re: uploading image in database

Storing a picture in a database is generally a bad idea... they are usually designed for fast retrieval operations of small bits of data, not saving massive picture files.
Team Colleague
Reputation Points: 63
Solved Threads: 6
Supreme Evil Overlord
Roberdin is offline Offline
282 posts
since Feb 2003
Oct 17th, 2004
0

Re: uploading image in database

You wouldnt normally store the actual image in the database, rather store/fetch its name from the database and include that in a html <img src="images/<?=$image_name_here?>"> tag..
In this example you would store your images on the server in the /images/ folder.
And call the name of the image to be placed in the <img> tag from the database.

Also there is the performance issue. Doing the above is fast and simple and exactly what SQL is intended for. Storing large image files like 100kb for example will decrease the performance of the specified task by 500% or more (guessing). Taking 0.5 seconds rather than 0.005... I'm sure you'll agree this can mount up with more concurrent users visit the page and request images from a database bloated with BLOB data.
Sorry, I'm going on a bit arent I. time to shut up ReDuX.
Reputation Points: 12
Solved Threads: 5
Junior Poster
ReDuX is offline Offline
127 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: how can i compressed any file as zip by php
Next Thread in PHP Forum Timeline: Help with Querystring error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC