RE: How can I display images from a mySQL Database in a web page?

2003-07-16 Thread Jef S
What I have found that works, in PHP, is using a form that allows the
user to browse for a file or an image. Upon submitting the form the file
is uploaded to a set location on the web server and the name of the file
is added to the database.

When displaying the information associated with the image, write the php
page so it has the image tag and all you do is query the database for
the name of the file. Let php do the rest.

I realize this isn't a php list but this is what I have done in the
past. You can check the www.php.net newsgroups archives for steps on
accomplishing this task.


Good luck,
Jef 

 -Original Message-
 From: Dan Anderson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 15, 2003 4:31 PM
 To: Partap Davis
 Cc: [EMAIL PROTECTED]
 Subject: Re: How can I display images from a mySQL Database in a web
page?
 
  I think there is a way to insert binary image data in your html, but
is
  there any particular reason you need to do that?
 
 Yes, my client's server is running with particularly restrictive PHP
 safe mode settings and has informed me that dynamic images are a /must
 have/.  :: bangs head against wall. starts to bleed ::
 
 So, it is relatively easy to store images into a BLOB, and slightly
 tricky to chop them up into the packet size and reassemble them.  But
 trying to figure out how to do this has boggled my mind and I
appreciate
 all the help of the community.  :)
 
 -Dan
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How can I display images from a mySQL Database in a web page?

2003-07-16 Thread Peter Burden
Dan Anderson wrote:

I have created a BLOB field to store images.  Is there any way to embed
them within HTML with something like:
I've done some  notes on this at
http://www.scit.wlv.ac.uk/~jphb/sst/php/extra/images1.html
- assuming of course you're using PHP as a WWW backend to
   dig the stuff out of the database.
image start: jpeg
/image
Thanks in advance,

Dan

 



--
From Peter Burden, [EMAIL PROTECTED]
http://www.scit.wlv.ac.uk/~jphb



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: How can I display images from a mySQL Database in a web page?

2003-07-16 Thread M. Bader

 image start: jpeg
 /image



use this:

echo 'img src='.mysql_result($conn, 0, 0).' alt=';

where 0,0 is the result-set index for your mysql field. you might
use other mysql functions of course, but the place to put the output
in is the same

the html-source code will look like it is only a normal image path,
but the server sends the binary data too


hope that helps
Maik




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How can I display images from a mySQL Database in a web page?

2003-07-15 Thread colbey

THis is kinda offtopic.. it depends on what frontend you are using to
access mysql (php,java,perl,etc) ..

You just need to pull the binary data and output it with the correct http
headers and it will show up in a browser..   search the list for more
info.  www.php4.com has an example using php..

good luck.


On Tue, 15 Jul 2003, Dan Anderson wrote:

 I have created a BLOB field to store images.  Is there any way to embed
 them within HTML with something like:

 image start: jpeg
 /image

 Thanks in advance,

 Dan


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How can I display images from a mySQL Database in a web page?

2003-07-15 Thread Partap Davis
I think there is a way to insert binary image data in your html, but is
there any particular reason you need to do that?

First you would need to encode it in some ascii equivalent (check w3c.org, I
think) ...and it would increase the size of your html page while rendering
the browser's image cache useless...

This will both increase the page's load time and your server's bandwidth
requirements, as well as possibly being a pita to implement :-/

I would suggest you store the image filenames in the table, and paste that
into your html...

-Partap


On 7/15/03 1:25 PM, Dan Anderson [EMAIL PROTECTED] wrote:

 I have created a BLOB field to store images.  Is there any way to embed
 them within HTML with something like:
 
 image start: jpeg
 /image
 
 Thanks in advance,
 
 Dan
 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How can I display images from a mySQL Database in a web page?

2003-07-15 Thread William R. Mussatto
 I think there is a way to insert binary image data in your html, but is
 there any particular reason you need to do that?

 First you would need to encode it in some ascii equivalent (check
 w3c.org, I think) ...and it would increase the size of your html page
 while rendering the browser's image cache useless...

 This will both increase the page's load time and your server's bandwidth
 requirements, as well as possibly being a pita to implement :-/

 I would suggest you store the image filenames in the table, and paste
 that into your html...

 -Partap


 On 7/15/03 1:25 PM, Dan Anderson [EMAIL PROTECTED] wrote:

 I have created a BLOB field to store images.  Is there any way to
 embed them within HTML with something like:

 image start: jpeg
 /image

 Thanks in advance,

 Dan
blob datatype.  But again why do this. use a file system and put the
file's address in the database.

William R. Mussatto, Senior Systems Engineer
Ph. 909-920-9154 ext. 27
FAX. 909-608-7061



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How can I display images from a mySQL Database in a web page?

2003-07-15 Thread Dan Anderson
 I think there is a way to insert binary image data in your html, but is
 there any particular reason you need to do that?

Yes, my client's server is running with particularly restrictive PHP
safe mode settings and has informed me that dynamic images are a /must
have/.  :: bangs head against wall. starts to bleed ::

So, it is relatively easy to store images into a BLOB, and slightly 
tricky to chop them up into the packet size and reassemble them.  But
trying to figure out how to do this has boggled my mind and I appreciate
all the help of the community.  :)

-Dan


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How can I display images from a mySQL Database in a web page?

2003-07-15 Thread Keith C. Ivey
On 15 Jul 2003 at 18:31, Dan Anderson wrote:

  I think there is a way to insert binary image data in your html, but
  is there any particular reason you need to do that?
 
 Yes, my client's server is running with particularly restrictive PHP
 safe mode settings and has informed me that dynamic images are a /must
 have/.  :: bangs head against wall. starts to bleed ::

Dynamic images don't require inserting binary data into your HTML.  
(It is possible to use 'data:' URLs to insert arbitrary data into 
your HTML, but very few broswers support it, and it's not relevant 
for your purposes).

The image and the HTML will come from separate HTTP requests, so all 
that's necessary is for you to put the appropriate URLs into the HTML 
and set up a corresponding PHP program to return the data, with the 
Content-type: image/gif (or whatever) header, and possibly others, 
depending on what you're trying to do.

Except for the process of retrieving the data from the database, this 
has nothing to do with MySQL, so questions related to HTML, PHP, and 
HTTP headers should be directed to another list.

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]