The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> store images in mysql
cking
post 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...
sad.gif sad.gif sad.gif sad.gif sad.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
cking
post Feb 20 2010, 02:03 AM
Post #3





Group: Members
Posts: 2
Joined: 20-February 10
Member No.: 11,147



QUOTE(Darin McGrew @ Feb 20 2010, 01:58 AM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ronaldo74
post 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)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th April 2024 - 06:12 PM