View Single Post
 
Old February 12th, 2007, 04:23 PM
harpua harpua is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default mysql is stripping slashes in serialized array

I have a problem hopefully somebody can help me out with. I am using serialize to store an array in MySQL. One of the values this array is 18" Franco Chain Necklace. What happens is that before it is inserted and I write unserialize($myArray) to the page there is an escape slash in front, so it reads like

a:1:{i:0;a:10:{s:7:"iItemID";i:5;s:8:"ItemName";s: 28:"Assemble your Spur & Rowel ©";s:12:"Descriptions";s:86:"18\" Franco Chain Necklace, 6pt_yg_stone

Now when this value is pulled from MySQL it is stripping the escape slash and will not return the array correctly.

a:1:{i:0;a:10:{s:7:"iItemID";i:5;s:8:"ItemName";s: 28:"Assemble your Spur & Rowel ©";s:12:"Descriptions";s:86:"18" Franco Chain Necklace, 6pt_yg_stone

I know this is the problem because I can update the DB and it works correctly. My question is how can I prevent MySQL from removing my slash. When I insert I am just using
serialize($arrAssemblyCart) I have tried serveral things but none of them work.

mike
__________________
Peace
Mike
http://www.eclecticpixel.com