SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Nov 16, 2004, 04:33 #1
How to insert image into database?
Is there any way to store an acutal image(jpeg, gif) into a database? I'm using a cms for my website, and I want to try and extract almost everything from the database, so that includes the images. Could someone show me how this can be accomplished?
Thanks.
-
Nov 16, 2004, 07:18 #2
-
Nov 16, 2004, 09:16 #3
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
It is called storing binary data in the database and yes it is possible. However, like Dave said, it is considered inefficient and looked down upon.
There is a good article at PHPBuilder about it though, if you are still interested: http://www.phpbuilder.com/columns/florian19991014.php3
Your best bet though is to store the location of the image in your database and just retrieve that. It will require less resources and be faster than if you stored the actual image in the database.ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
Bookmarks