FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Problem with special char in MySQL and XML
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Problem with special char in MySQL and XML [message #174838 is a reply to message #174834] Wed, 13 July 2011 00:19 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Tue, 12 Jul 2011 13:02:54 -0700, Sarah wrote:

> Hi! I've a table UTF8_general_ci where I've symbols like: & è , à ' ...
>
> I've seen that when I try to generate an XML file (that works OK with
> other tables) I show this error:
>
>
> Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]:
> unterminated entity reference Pizza in /var/www/domain.com/xmlfeed.php
> on line 164
>
> In my PHP code I've something like this:
>
> $aaa->addChild('date', strip_tags(utf8_encode($row{'Date'})) );
> $aaa->addChild('title', strip_tags(utf8_encode($row{'Title'})) );
>
>
> Where is it my error?

Perhaps wrap the data in a call to either htmlentities() or
htmlspecialchars() - you won't need both, I don't know which would be
best for your purpose, but I suspect htmlentities().

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: xml rpc request with mynewsletter builder
Next Topic: how to implement AJAX to html
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 06:49:44 GMT 2024

Total time taken to generate the page: 0.03820 seconds