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, <JPG>);
> >     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

Reply via email to