| | |
uploading image in database
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2003
Posts: 282
Reputation:
Solved Threads: 6
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.
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.
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.
![]() |
Similar Threads
- displaying image from database (PHP)
- how to save image into database (VB.NET)
- problem in uploading image (Java)
- uploading Images into Database (ASP.NET)
- retieve image from database (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: how can i compressed any file as zip by php
- Next Thread: Help with Querystring error
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white xml youtube





