store images in mysql |
store images in mysql |
cking |
Feb 20 2010, 01:23 AM
Post
#1
|
Group: Members Posts: 2 Joined: 20-February 10 Member No.: 11,147 |
How I store the images in a MySQL database and retrive when i need???
I'm creating a online shopping website as my assgnment. if anyone know it please help me. If its possible please give me a sample code... |
Darin McGrew |
Feb 20 2010, 01:58 AM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
FWIW, it's often easier to store the images elsewhere, and to store only the URLs of the images in the database.
|
cking |
Feb 20 2010, 02:03 AM
Post
#3
|
Group: Members Posts: 2 Joined: 20-February 10 Member No.: 11,147 |
FWIW, it's often easier to store the images elsewhere, and to store only the URLs of the images in the database. Thakx for ur information. I have tried it also, but do you know any way to store images on the database and retrive it as a image, not from url. |
Brian Chandler |
Feb 20 2010, 03:22 AM
Post
#4
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
Yes, obviously, you use a field of type "blob" and save the bytes of the file to it.
But what do you mean "I have tried it also"?? What do you mean by "retrieve as an image"? SQL doesn't (AFAIK) do anything useful with images, but if you are using php you can do lots of stuff with images using the graphics library. But then it makes no difference whether you get the image from a DB field or by opening an ordinary file. If you could explain what you can't do, or what you are trying to do it would help. |
Ronaldo74 |
May 10 2010, 01:41 PM
Post
#5
|
Group: Members Posts: 4 Joined: 16-December 09 Member No.: 10,598 |
I agree with other answers, most leader shopping carts like Comersus and osCommerce store only the link to the image (and the image can be uploaded anywhere)
|
Lo-Fi Version | Time is now: 27th April 2024 - 10:02 PM |