Re: Fw: Data from SQL to a string in a useable format
| From: | Sheridan Saint-Michel | Date: | Wed, 18 Jul 2001 18:57:32 +0000 |
| Subject: | Re: Fw: Data from SQL to a string in a useable format | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-58512@lists.php.net to get a copy of this message | ||
This may be way out in left field... but since no one else seems to be
answering,
Have you considered using something like base64_encode?
http://www.php.net/manual/en/function.base64-encode.php
That would change your image to plaintext without any characters that need
to be escaped.
The when you retrieve it you would just run it through base64_decode and
viola!
I have never tried this, and like I said there may very well be a better
solution.
(Especially since the DB is usually the bottleneck and base64_encode
actually makes the file bigger)
Let me know if that helps
Sheridan
----- Original Message -----
From: Jason Bell <jbell@barkingrat.com>
To: PHP Users <php-general@lists.php.net>
Sent: Wednesday, July 18, 2001 11:51 AM
Subject: [PHP] Fw: Data from SQL to a string in a useable format
Ok, never got a reply yesterday, so I figured I'd resend this..... can this
even be done?
__________________________________
How can I pull my data from my SQL db, and store it as a string so that it
can be used? Specificly, I'm working with images.
When the images are stored in the database, the only pre-processing that is
done is:
$img = addslashes(fread(fopen($userfile, "r"), filesize($userfile)));
(* note: $userfile is the file identifier from my upload form.)
I want to pull the data out of the database and store it in a string, so
that I can use imagecopyresampled to create a thumbnail, but I just can't
seem to get it to work....
please help!!!!!!
Thanks, Jason