Re: store JPG in MySQL DB

2002-05-20 Thread Cecil Brand

Wel it depends on what you want to do. If it's webpages, the file system idea is 
ideal, but
if its a binary run by many people on different machines you'll have to map the 
directory holding the images
to every machine. That a big no no, due to security risks getting higher. The db idea 
is then the best.
Try to have a backup sever or two (if you can affort it ), for the change of the main 
one crashing.

Mnr Cecil J.C. Brand
Internet Office
RekenaarDienste
University of the Free State/
Universiteit van die Vrystaat
PO Box 339
Bloemfontein 9300
South Africa

Tel   :401 2645
Email :[EMAIL PROTECTED]

>>> "Andrei Cojocaru" <[EMAIL PROTECTED]> 05/20/02 05:45PM >>>
well, let's just say if it crashes it will mean longer recovery time, you
are adding extra processing to the SQL server to handle data it wasn't meant
to handle, storing it in the file system has the main advantage that if any
changes occurs you can change it faster + easier, besides a database is
supposed to store essential data so you don't overload it with things that
can be calculated or made pretty easily, and I'd say an image fits under
that category. And last time I checked my local hard drive is faster than my
network connection :) The choice is yours, but if you have heavy load, I
wouldn't use it.

Andrei Cojocaru
[EMAIL PROTECTED] 
- Original Message -
From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
To: "Andrei Cojocaru" <[EMAIL PROTECTED]>
Cc: "Sameer Maggon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 9:37 AM
Subject: Re: store JPG in MySQL DB


>
> Hi Andrei
>
> > If I were you I would not store a binary file into the database, I'd
store
> > the information required to fetch it from somewhere else like the mySQL
> > manual suggests
>
> But what difference does it make? Besides, I found storing it in the DB
> more convenient than in the file system. In that case, you will have to
> keep track ofboh the files in the file system, and their meta data in the
> mysql tables.
>
> Please advise
>
>
>
> > 
> > Andrei Cojocaru
> > [EMAIL PROTECTED] 
> > - Original Message -
> > From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> > To: "Sameer Maggon" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Monday, May 20, 2002 12:26 AM
> > Subject: Re: store JPG in MySQL DB
> >
> >
> > >
> > > For real-life example, check out http://cdbaza.ultracgis.com, and
check
> > > out the filename
> > > of the thumbnails images. I'm SELECTing those images from the MySQL
> > > database.
> > >
> > > That's how it's done:
> > >
> > > 1_ Create a table to store your JPGs, and the column that holds JPG
data
> > >should be declared as BLOB
> > >
> > > CREATE TABLE images (
> > > image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
> > > image BLOB NOT NULL
> > > );
> > >
> > >
> > >  2_ Now you are ready to load the JPG data into the image column.
> > > I use Perl to open the JPG file and dump the contents into the
table,
> > > and the resulting query looks something like:
> > >
> > > INSERT INTO images SET image="here goes contents of the JPG file";
> > >
> > > Perl code that does this job would look like:
> > >
> > > local ($/);
> > > sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
> > > $dbh->do(qq|INSERT INTO images SET image=?|, undef, );
> > > close (JPG);
> > >
> > > Sorry if you don't know Perl, but you should be able to do similar
> > > thing in any other language you might be using
> > >
> > >
> > >
> > > Good luck!
> > >
> > > --
> > > Sherzod
> > >
> > >
> > >
> > >
> > > -
> > > 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 
> > >
> > >
> >
> >
>
>


-
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 


-
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




Re: store JPG in MySQL DB

2002-05-20 Thread Andrei Cojocaru

I wouldn't know how likely it is to crash, but it will happen eventually,
nothing is perfect :(

Andrei Cojocaru
[EMAIL PROTECTED]
- Original Message -
From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
To: "Andrei Cojocaru" <[EMAIL PROTECTED]>
Cc: "Sameer Maggon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 9:54 AM
Subject: Re: store JPG in MySQL DB


>
> Hi Andrei
>
> > well, let's just say if it crashes it will mean longer recovery time,
you
> > are adding extra processing to the SQL server to handle data it wasn't
meant
> > to handle, storing it in the file system has the main advantage that if
any
>
> Yeah, that "crash" thing really scares me. I guess you're right about
> . And how likely that it might crash?
>
>
>
> > changes occurs you can change it faster + easier, besides a database is
> > supposed to store essential data so you don't overload it with things
that
> > can be calculated or made pretty easily, and I'd say an image fits under
> > that category. And last time I checked my local hard drive is faster
than my
> > network connection :) The choice is yours, but if you have heavy load, I
> > wouldn't use it.
> > 
> > Andrei Cojocaru
> > [EMAIL PROTECTED]
> > - Original Message -
> > From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> > To: "Andrei Cojocaru" <[EMAIL PROTECTED]>
> > Cc: "Sameer Maggon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Monday, May 20, 2002 9:37 AM
> > Subject: Re: store JPG in MySQL DB
> >
> >
> > >
> > > Hi Andrei
> > >
> > > > If I were you I would not store a binary file into the database, I'd
> > store
> > > > the information required to fetch it from somewhere else like the
mySQL
> > > > manual suggests
> > >
> > > But what difference does it make? Besides, I found storing it in the
DB
> > > more convenient than in the file system. In that case, you will have
to
> > > keep track ofboh the files in the file system, and their meta data in
the
> > > mysql tables.
> > >
> > > Please advise
> > >
> > >
> > >
> > > > 
> > > > Andrei Cojocaru
> > > > [EMAIL PROTECTED]
> > > > - Original Message -
> > > > From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> > > > To: "Sameer Maggon" <[EMAIL PROTECTED]>
> > > > Cc: <[EMAIL PROTECTED]>
> > > > Sent: Monday, May 20, 2002 12:26 AM
> > > > Subject: Re: store JPG in MySQL DB
> > > >
> > > >
> > > > >
> > > > > For real-life example, check out http://cdbaza.ultracgis.com, and
> > check
> > > > > out the filename
> > > > > of the thumbnails images. I'm SELECTing those images from the
MySQL
> > > > > database.
> > > > >
> > > > > That's how it's done:
> > > > >
> > > > > 1_ Create a table to store your JPGs, and the column that holds
JPG
> > data
> > > > >should be declared as BLOB
> > > > >
> > > > > CREATE TABLE images (
> > > > > image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
> > > > > image BLOB NOT NULL
> > > > > );
> > > > >
> > > > >
> > > > >  2_ Now you are ready to load the JPG data into the image column.
> > > > > I use Perl to open the JPG file and dump the contents into the
> > table,
> > > > > and the resulting query looks something like:
> > > > >
> > > > > INSERT INTO images SET image="here goes contents of the JPG
file";
> > > > >
> > > > > Perl code that does this job would look like:
> > > > >
> > > > > local ($/);
> > > > > sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
> > > > > $dbh->do(qq|INSERT INTO images SET image=?|, undef, );
> > > > > close (JPG);
> > > > >
> > > > > Sorry if you don't know Perl, but you should be able to do similar
> > > > > thing in any other language you might be using
> > > > >
> > > > >
> > > > >
> > > > > Good luck!
> > > > >
> > > > > --
> > > > > Sherzod
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> -
> > > > > 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
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


-
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




RE: store JPG in MySQL DB

2002-05-20 Thread Soheil Shaghaghi

Hello everyone.
While you are on this subject, can I ask you a question?
Is it possible to store sound, or video in the mySQL database? If so, is it
wise? Are there any performance issues I should be aware of
I just want my users to be able to add their photo, and sound (or maybe a
short video) to their profile.

Thanks so much,
Soheil


-Original Message-
From: Sherzod B. Ruzmetov [mailto:[EMAIL PROTECTED]]
Sent: Mon, May 20, 2002 8:37 AM
To: Andrei Cojocaru
Cc: Sameer Maggon; [EMAIL PROTECTED]
Subject: Re: store JPG in MySQL DB



Hi Andrei

> If I were you I would not store a binary file into the database, I'd store
> the information required to fetch it from somewhere else like the mySQL
> manual suggests

But what difference does it make? Besides, I found storing it in the DB
more convenient than in the file system. In that case, you will have to
keep track ofboh the files in the file system, and their meta data in the
mysql tables.

Please advise



> 
> Andrei Cojocaru
> [EMAIL PROTECTED]
> - Original Message -
> From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> To: "Sameer Maggon" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, May 20, 2002 12:26 AM
> Subject: Re: store JPG in MySQL DB
>
>
> >
> > For real-life example, check out http://cdbaza.ultracgis.com, and check
> > out the filename
> > of the thumbnails images. I'm SELECTing those images from the MySQL
> > database.
> >
> > That's how it's done:
> >
> > 1_ Create a table to store your JPGs, and the column that holds JPG data
> >should be declared as BLOB
> >
> > CREATE TABLE images (
> > image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
> > image BLOB NOT NULL
> > );
> >
> >
> >  2_ Now you are ready to load the JPG data into the image column.
> > I use Perl to open the JPG file and dump the contents into the
table,
> > and the resulting query looks something like:
> >
> > INSERT INTO images SET image="here goes contents of the JPG file";
> >
> > Perl code that does this job would look like:
> >
> > local ($/);
> > sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
> > $dbh->do(qq|INSERT INTO images SET image=?|, undef, );
> > close (JPG);
> >
> > Sorry if you don't know Perl, but you should be able to do similar
> > thing in any other language you might be using
> >
> >
> >
> > Good luck!
> >
> > --
> > Sherzod
> >
> >
> >
> >
> > -
> > 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
> >
> >
>
>


-
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



-
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




Re: store JPG in MySQL DB

2002-05-20 Thread Sherzod B. Ruzmetov


Hi Andrei

> well, let's just say if it crashes it will mean longer recovery time, you
> are adding extra processing to the SQL server to handle data it wasn't meant
> to handle, storing it in the file system has the main advantage that if any

Yeah, that "crash" thing really scares me. I guess you're right about 
. And how likely that it might crash?



> changes occurs you can change it faster + easier, besides a database is
> supposed to store essential data so you don't overload it with things that
> can be calculated or made pretty easily, and I'd say an image fits under
> that category. And last time I checked my local hard drive is faster than my
> network connection :) The choice is yours, but if you have heavy load, I
> wouldn't use it.
> 
> Andrei Cojocaru
> [EMAIL PROTECTED]
> - Original Message -
> From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> To: "Andrei Cojocaru" <[EMAIL PROTECTED]>
> Cc: "Sameer Maggon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, May 20, 2002 9:37 AM
> Subject: Re: store JPG in MySQL DB
> 
> 
> >
> > Hi Andrei
> >
> > > If I were you I would not store a binary file into the database, I'd
> store
> > > the information required to fetch it from somewhere else like the mySQL
> > > manual suggests
> >
> > But what difference does it make? Besides, I found storing it in the DB
> > more convenient than in the file system. In that case, you will have to
> > keep track ofboh the files in the file system, and their meta data in the
> > mysql tables.
> >
> > Please advise
> >
> >
> >
> > > ----
> > > Andrei Cojocaru
> > > [EMAIL PROTECTED]
> > > - Original Message -
> > > From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> > > To: "Sameer Maggon" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Monday, May 20, 2002 12:26 AM
> > > Subject: Re: store JPG in MySQL DB
> > >
> > >
> > > >
> > > > For real-life example, check out http://cdbaza.ultracgis.com, and
> check
> > > > out the filename
> > > > of the thumbnails images. I'm SELECTing those images from the MySQL
> > > > database.
> > > >
> > > > That's how it's done:
> > > >
> > > > 1_ Create a table to store your JPGs, and the column that holds JPG
> data
> > > >should be declared as BLOB
> > > >
> > > > CREATE TABLE images (
> > > > image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
> > > > image BLOB NOT NULL
> > > > );
> > > >
> > > >
> > > >  2_ Now you are ready to load the JPG data into the image column.
> > > > I use Perl to open the JPG file and dump the contents into the
> table,
> > > > and the resulting query looks something like:
> > > >
> > > > INSERT INTO images SET image="here goes contents of the JPG file";
> > > >
> > > > Perl code that does this job would look like:
> > > >
> > > > local ($/);
> > > > sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
> > > > $dbh->do(qq|INSERT INTO images SET image=?|, undef, );
> > > > close (JPG);
> > > >
> > > > Sorry if you don't know Perl, but you should be able to do similar
> > > > thing in any other language you might be using
> > > >
> > > >
> > > >
> > > > Good luck!
> > > >
> > > > --
> > > > Sherzod
> > > >
> > > >
> > > >
> > > >
> > > > -
> > > > 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
> > > >
> > > >
> > >
> > >
> >
> >
> 
> 


-
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




Re: store JPG in MySQL DB

2002-05-20 Thread Andrei Cojocaru

well, let's just say if it crashes it will mean longer recovery time, you
are adding extra processing to the SQL server to handle data it wasn't meant
to handle, storing it in the file system has the main advantage that if any
changes occurs you can change it faster + easier, besides a database is
supposed to store essential data so you don't overload it with things that
can be calculated or made pretty easily, and I'd say an image fits under
that category. And last time I checked my local hard drive is faster than my
network connection :) The choice is yours, but if you have heavy load, I
wouldn't use it.

Andrei Cojocaru
[EMAIL PROTECTED]
- Original Message -
From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
To: "Andrei Cojocaru" <[EMAIL PROTECTED]>
Cc: "Sameer Maggon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 9:37 AM
Subject: Re: store JPG in MySQL DB


>
> Hi Andrei
>
> > If I were you I would not store a binary file into the database, I'd
store
> > the information required to fetch it from somewhere else like the mySQL
> > manual suggests
>
> But what difference does it make? Besides, I found storing it in the DB
> more convenient than in the file system. In that case, you will have to
> keep track ofboh the files in the file system, and their meta data in the
> mysql tables.
>
> Please advise
>
>
>
> > 
> > Andrei Cojocaru
> > [EMAIL PROTECTED]
> > - Original Message -
> > From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
> > To: "Sameer Maggon" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Monday, May 20, 2002 12:26 AM
> > Subject: Re: store JPG in MySQL DB
> >
> >
> > >
> > > For real-life example, check out http://cdbaza.ultracgis.com, and
check
> > > out the filename
> > > of the thumbnails images. I'm SELECTing those images from the MySQL
> > > database.
> > >
> > > That's how it's done:
> > >
> > > 1_ Create a table to store your JPGs, and the column that holds JPG
data
> > >should be declared as BLOB
> > >
> > > CREATE TABLE images (
> > > image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
> > > image BLOB NOT NULL
> > > );
> > >
> > >
> > >  2_ Now you are ready to load the JPG data into the image column.
> > > I use Perl to open the JPG file and dump the contents into the
table,
> > > and the resulting query looks something like:
> > >
> > > INSERT INTO images SET image="here goes contents of the JPG file";
> > >
> > > Perl code that does this job would look like:
> > >
> > > local ($/);
> > > sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
> > > $dbh->do(qq|INSERT INTO images SET image=?|, undef, );
> > > close (JPG);
> > >
> > > Sorry if you don't know Perl, but you should be able to do similar
> > > thing in any other language you might be using
> > >
> > >
> > >
> > > Good luck!
> > >
> > > --
> > > Sherzod
> > >
> > >
> > >
> > >
> > > -
> > > 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
> > >
> > >
> >
> >
>
>


-
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




Re: store JPG in MySQL DB

2002-05-20 Thread Andrei Cojocaru

If I were you I would not store a binary file into the database, I'd store
the information required to fetch it from somewhere else like the mySQL
manual suggests

Andrei Cojocaru
[EMAIL PROTECTED]
- Original Message -
From: "Sherzod B. Ruzmetov" <[EMAIL PROTECTED]>
To: "Sameer Maggon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 12:26 AM
Subject: Re: store JPG in MySQL DB


>
> For real-life example, check out http://cdbaza.ultracgis.com, and check
> out the filename
> of the thumbnails images. I'm SELECTing those images from the MySQL
> database.
>
> That's how it's done:
>
> 1_ Create a table to store your JPGs, and the column that holds JPG data
>should be declared as BLOB
>
> CREATE TABLE images (
> image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
> image BLOB NOT NULL
> );
>
>
>  2_ Now you are ready to load the JPG data into the image column.
> I use Perl to open the JPG file and dump the contents into the table,
> and the resulting query looks something like:
>
> INSERT INTO images SET image="here goes contents of the JPG file";
>
> Perl code that does this job would look like:
>
> local ($/);
> sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
> $dbh->do(qq|INSERT INTO images SET image=?|, undef, );
> close (JPG);
>
> Sorry if you don't know Perl, but you should be able to do similar
> thing in any other language you might be using
>
>
>
> Good luck!
>
> --
> Sherzod
>
>
>
>
> -
> 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
>
>


-
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




Re: Re: store JPG in MySQL DB

2002-05-20 Thread Sameer Maggon

Hi,
  That explains me a problem but i could not see strmov()
  function any where, while linking with -lmysqlclient also
  it gives unreferenced function..

  I am using Mysql 3.23

  Please help 
  Sameer

--
you wrote:

Sameer,
Monday, May 20, 2002, 11:17:48 AM, you wrote:

SM>   Can you please put some light on it.. How i can do it, or is
SM>   it described in manual

You can insert file into BLOB field using INSERT statement and
retrieve file using SELECT.
To insert file you can use LOAD_FILE() function:
  http://www.mysql.com/doc/S/t/String_functions.html

In other cases don't forget to escape chars:
  http://www.mysql.com/doc/S/t/String_syntax.html

SM>   Sameer




-- 
For technical support contracts, goto https://order.mysql.com/?
ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-
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 
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php







--
http://www.dypatil.edu For Better tomorrow

-
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




Re: Re: store JPG in MySQL DB

2002-05-20 Thread Victoria Reznichenko

Sameer,
Monday, May 20, 2002, 11:17:48 AM, you wrote:

SM>   Can you please put some light on it.. How i can do it, or is
SM>   it described in manual

You can insert file into BLOB field using INSERT statement and
retrieve file using SELECT.
To insert file you can use LOAD_FILE() function:
  http://www.mysql.com/doc/S/t/String_functions.html

In other cases don't forget to escape chars:
  http://www.mysql.com/doc/S/t/String_syntax.html

SM>   Sameer




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-
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




Re: store JPG in MySQL DB

2002-05-19 Thread Sherzod B. Ruzmetov


For real-life example, check out http://cdbaza.ultracgis.com, and check 
out the filename 
of the thumbnails images. I'm SELECTing those images from the MySQL 
database.

That's how it's done:

1_ Create a table to store your JPGs, and the column that holds JPG data
   should be declared as BLOB

CREATE TABLE images (
image_id INT UNSIGNED NOT NULL AUT_INCREMENT PRIMARY KEY,
image BLOB NOT NULL
);

 
 2_ Now you are ready to load the JPG data into the image column.
I use Perl to open the JPG file and dump the contents into the table,
and the resulting query looks something like:

INSERT INTO images SET image="here goes contents of the JPG file";

Perl code that does this job would look like:

local ($/);
sysopen (JPG, "test.jpg", O_RDONLY) or die $!;
$dbh->do(qq|INSERT INTO images SET image=?|, undef, );
close (JPG);

Sorry if you don't know Perl, but you should be able to do similar
thing in any other language you might be using



Good luck!

--  
Sherzod
  



-
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




Re: store JPG in MySQL DB

2002-05-19 Thread Sameer Maggon

Hi,
  Can you please put some light on it.. How i can do it, or is
  it described in manual

  Sameer

--
you wrote:


Hi 
> Hi,
>   Can i have a table in which i can store my JPG file somehow in
>   MYSQL database.


Absolutely. 

just declare a BLOB column, and load your images rightinto the columsn

>   Sameer






--
http://www.dypatil.edu For Better tomorrow

-
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




Re: store JPG in MySQL DB

2002-05-19 Thread Sherzod B. Ruzmetov


Hi 
> Hi,
>   Can i have a table in which i can store my JPG file somehow in
>   MYSQL database.


Absolutely. 

just declare a BLOB column, and load your images rightinto the columsn

>   Sameer
> 
> 
> 
> 
> 
> 
> 
> --
> http://www.dypatil.edu For Better tomorrow
> 
> -
> 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
> 
> 


-
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