uploading image in database

Reply

Join Date: Oct 2004
Posts: 1
Reputation: sunil kumar bob is an unknown quantity at this point 
Solved Threads: 0
sunil kumar bob sunil kumar bob is offline Offline
Newbie Poster

uploading image in database

 
0
  #1
Oct 12th, 2004
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: uploading image in database

 
0
  #2
Oct 13th, 2004
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 127
Reputation: ReDuX is an unknown quantity at this point 
Solved Threads: 5
ReDuX's Avatar
ReDuX ReDuX is offline Offline
Junior Poster

Re: uploading image in database

 
0
  #3
Oct 17th, 2004
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC