Re: Writing a GIF/JPG Image
| From: | Brandon | Date: | Sat, 29 Jun 2002 00:17:08 +0000 |
| Subject: | Re: Writing a GIF/JPG Image | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104444@lists.php.net to get a copy of this message | ||
Thanks a ton! Will try that.
"Rasmus Lerdorf" <rasmus@php.net> wrote in message
news:Pine.LNX.4.44.0206281705180.2929-100000@www.lerdorf.com...
> You wouldn't. You would write a script like fetch_image.php in which you
> would do the mysql_query() and simply echo out the image data. Then in
> your main HTML file you would use:
>
> <img src="fetch_image.php">
>
> You can pass information to this script either via GET-method args. eg.
>
> <img src="fetch_image.php?id=123">
>
> Or cooler would be to do an Apache ForceType to the PHP mime type on a
> file named "images" in your doc_root and put the fetch image code into
> thise images file. Then use:
>
> <img src="/images/123.jpg">
>
> And in your "images" script you would pick the image name out of
> $PATH_INFO and do the appropriate mysql query.
>
> -Rasmus
>
> On Fri, 28 Jun 2002, Brandon wrote:
>
> > I would like to store a jpg/gif image in a MySQL database (as a BLOB
type I
> > guess ;p), how would I output that into an <img src=""> in php?
> >
> > Thanks in advance,
> > brandon
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>