alistz
11-24-2008, 12:47 PM
This is a problem I'm stuck on:
I have a column in a mysql table that is an XML string.
When I create the record for the column I use htmlentities() so my user can add quotes when he types input into the heading.
looks like this :
$holdcolumn = '<message><head>htmlentities($head)</head><replies></replies></messsage>;
All is good, until I want to add a reply. When I Select the column from my table I place the result in an XML object. I then I update the <replies></replies> using $xml->replies->addChild('reply',"$replykey")
I then convert the xml to a string: $xmltext = $xml->asXML() so i can update the record
When I update the record's column in mysql I get an error because the quotes are back in the $xmltext and affecting the SQL string.
I"m not sure how to handle this, it seems like there should be a simple answer?
I have a column in a mysql table that is an XML string.
When I create the record for the column I use htmlentities() so my user can add quotes when he types input into the heading.
looks like this :
$holdcolumn = '<message><head>htmlentities($head)</head><replies></replies></messsage>;
All is good, until I want to add a reply. When I Select the column from my table I place the result in an XML object. I then I update the <replies></replies> using $xml->replies->addChild('reply',"$replykey")
I then convert the xml to a string: $xmltext = $xml->asXML() so i can update the record
When I update the record's column in mysql I get an error because the quotes are back in the $xmltext and affecting the SQL string.
I"m not sure how to handle this, it seems like there should be a simple answer?