Re: Why are slashes automatically stripped from db result?

From: Date: Tue, 04 Dec 2001 00:16:47 +0000
Subject: Re: Why are slashes automatically stripped from db result?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-76436@lists.php.net to get a copy of this message
I believe you're correct Martin. I think newer versions of MySQL automatically strip them out. Just use php's stripslashes() and addslashes() functions when you need them. Good luck Steve, Tyler Longren ----- Original Message ----- From: "Martin Towell" <martin.towell@world.net> To: "'Steve Cayford'" <steve_cayford@unioncab.com>; <php-general@lists.php.net> Sent: Monday, December 03, 2001 6:04 PM Subject: RE: [PHP] Why are slashes automatically stripped from db result? > maybe mysql is stripping the slashes and not php ?? > > -----Original Message----- > From: Steve Cayford [mailto:steve_cayford@unioncab.com] > Sent: Tuesday, December 04, 2001 10:57 AM > To: php-general@lists.php.net > Subject: [PHP] Why are slashes automatically stripped from db result? > > > Hey all. I'm storing some jpeg images in a mysql database using the PEAR > classes. Before inserting the image into the db I call addslashes() on > the data, I was, accordingly, calling stripslashes() on the data after > pulling the image back out of the database, but the image was getting > mangled. I finally realized that the slashes were already stripped from > my query results so stripping them again was removing legitimate slashes. > > The question is: why are the slashes already stripped out of the db > results? I call set_magic_quotes_runtime(0) at the beginning of the > scripts to turn off magic quoting. What else would cause this? > > Thanks for any suggestions. > > -Steve > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#76436) next »