Bin Cai schrieb am Donnerstag, 23. August 2001, 23:24:01:

> could you tell me how to store image in mysql database and display on web
> using java. urgently


Do it like any other insert, but care for special characters. In
php, you would wrap data with addSlashes() and remove them on
retrieval with stripSlashes().

But... you better not insert images into a table. Yes, you can do
it, but it is generally considered a bad idea. Read about it at
http://www.bitbybit.dk/mysqlfaq/ - if the images have to be
provided by users, use the upload functions of your system. php
for example has upload support built in.

Next you have to care for the appropriate write rights for those
files. These can be handled safely without compromising system
security. Store all data associated with the pictures in a table
except the picture itself, which should be taken care of by the
file sytem.

rasmus on files in databases:

       When dealing with images, it is of course possible to
       insert the image data into the database as binary blobs.
       However, the value in doing that is questionable. Until
       databases provide you with cool pattern recognition tools
       that will let you search a blob for a picture of a rose,
       having the image data itself in the database isn't of much
       use. Every operating system comes with a finely tuned blob
       database. It is called your file system. So, just put the
       full-path filename into the database and leave the images
       sitting somewhere on your disk. You will save yourself
       much aggrevation in the long run.

http://conf.php.net/pres/index.php?p=slides%2Fintro&id=or2001


Herzlich
Werner

-- 
MySQL in Deutschland: Anpassung, Unterstützung, Schulung für Sie
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Dr. Werner Stürenburg <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Consultant
/_/  /_/\_, /___/\___\_\___/   Bielefeld, Germany
       <___/   www.mysql.com   +49-5224-997-407  Fax -409



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to