pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Patrick Hatcher <PHatcher@macys.com>
To: Cornelia Boenigk <c@cornelia-boenigk.de>
Cc: PGSQL+PHP <pgsql-php@postgresql.org>
Subject: Re: How do I display an image?
Date: Thu, 24 Oct 2002 05:46:36 -0700
Message-ID: <OF93F7AE09.B8EEB0CE-ON88256C5C.00462824@fds.com> (raw)


that did it!  Thank you very much

Patrick Hatcher
Macys.Com
Legacy Integration Developer





                                                                                                                         
                    "Cornelia Boenigk"                                                                                   
                    <poppcorn@cornelia-b       To:     "PGSQL+PHP" <pgsql-php@postgresql.org>, "Patrick Hatcher"         
                    oenigk.de>                  <PHatcher@macys.com>                                                     
                                               cc:                                                                       
                    10/23/2002 05:36 PM        Subject:     Re: [PHP] How do I display an image?                         
                    Please respond to                                                                                    
                    "Cornelia Boenigk"                                                                                   
                                                                                                                         
                                                                                                                         




Hi Patrick

Before storing the binary data in the BYTEA-Field use

pg_escape_bytea($imagedata)

After retrieving the imagedata from the table you must remove the slashes
the above function added. Use stripCslashes().

$image = stripcslashes($imagedata);

This works for me;-)
pg_escape_bytea() is available since php 4.2.0.

regards
Conni









view thread (4+ messages)  latest in thread

Message-ID: <OF93F7AE09.B8EEB0CE-ON88256C5C.00462824@fds.com>
Permalink:  ../OF93F7AE09.B8EEB0CE-ON88256C5C.00462824@fds.com/
Also on:    postgresql.org/message-id/OF93F7AE09.B8EEB0CE-ON88256C5C.00462824@fds.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: PHatcher@macys.com, c@cornelia-boenigk.de
  Subject: Re: How do I display an image?
  In-Reply-To: <OF93F7AE09.B8EEB0CE-ON88256C5C.00462824@fds.com>
  References: <OF93F7AE09.B8EEB0CE-ON88256C5C.00462824@fds.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox