Page 1 of 1

mySQL text field with php & xml

Posted: Mon Aug 30, 2010 11:45 am
by driacg06
I've gotten most of my php file system working, with one exception. I can't seem to get my php code to get the text data from the server. The server field is set up as a longtext type, with no other major parameters. The php code grab any other data i select from it, but that text field.

Code: Select all

$query = "SELECT showname, ShowDate, ShowTime, URLText, Details, imageURL FROM $tb_name WHERE ShowDate >= NOW() ORDER BY ShowDate";
$result = @mysql_query($query, $connection);

//Create XML Document
$dom = new DOMDocument("1.0");
$dom->formatOutput = true;

//Create root node
$root = $dom->createElement("list");
$dom->appendChild($root);

while($row = @mysql_fetch_assoc($result))
{
	$occ = $dom->createElement($tb_name);
	$root->appendChild($occ);
	foreach ($row as $fieldname => $fieldvalue)
	{
		$child = $dom->createElement($fieldname);
		$occ->appendChild($child);

		$value = $dom->createTextNode($fieldvalue);
		$child->appendChild($value);		
		
	};
}

echo $dom->saveXML();
$dom->save("xml.xml");
Any thoughts?