RE: [PHP] Why does this work on one server, but not another?

From: Date: Fri, 24 Mar 2006 01:02:02 +0000
Subject: RE: [PHP] Why does this work on one server, but not another?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-232490@lists.php.net to get a copy of this message
[snip author="Michael Crute"] I would base64encode the image string before puting it into the database then you would probably not run in to quoting issues. [/snip] Have you tried this? I realise a base64 increases the size of the target but it recognised as the best way of storing an image in a DB Apologies if this has already been restated :) Another thought: What type of field are you using for this storage? Dan ------------------- http://chrome.me.uk -----Original Message----- From: tedd [mailto:tedd@sperling.com] Sent: 24 March 2006 00:42 To: php-general@lists.php.net Subject: RE: [PHP] Why does this work on one server, but not another? Hi gang: Okay, another update: I tried all sorts of combinations of assorted functions as well as reading every source I could find. I won't bore you with the details -- but, this is as far as I've gotten. For storing an image into MySQL I simply used: $image_large = mysql_real_escape_string($buffer); Then for displaying the image, I use: if (get_magic_quotes_gpc()) { $fileContent = stripslashes($fileContent); } This now works for the server that didn't work before. However, the other server now doesn't show an image unless I comment out stripslashes($fileContent) statement -- and then it works. So, I have found solutions for both servers, just not one solution that works for both servers. Remember, both servers show "magic_quotes_gpc" as ON. The only difference I see between them is that "magic_quotes_runtime" is ON for one server and is OFF for the other -- would that make a difference? What say you now? tedd -- ---------------------------------------------------------------------------- ---- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __________ NOD32 1.1456 (20060323) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com

« previous php.general (#232490) next »