I save a XML file content in MySQL database with:
$content = mysql_escape_string($content);
$insert = mysql_query("insert into $db_table_xml (url,content) values ('$url','$content')" );
//content type : TEXT in MySQL
simplexml_load_string($content);
it returns an error:
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 361: parser error : AttValue: ' expected in D:\mkw\dev\Web\PHPnow-1.5.6\htdocs\yt2\common.php on line 84
Notice: Trying to get property of non-object in D:\mkw\dev\Web\PHPnow-1.5.6\htdocs\yt2\common.php on line 146
Warning: Invalid argument supplied for foreach() in D:\mkw\dev\Web\PHPnow-1.5.6\htdocs\yt2\common.php on line 146
simplexml_load_string($content);is trying to read your escaped content, which turns it into invalid, xml. try to escape the content to insert in your query in a different variable, so you can load the original content in as xml - Ibu