PHP to XML foreach from mySQL

SnelleMuG

New Member
Below is the code i am using to create a video list of my movies. for some reason i cant get the media:content to work.This is what I have now\[code\]$xml_output .= "\t<media:content url='" . $row['name'].".m4v" . " type='video/mpg' />\n";\[/code\]Here is the whole thing\[code\] $xml_output = "<?xml version=\"1.0\"?>\n"; $xml_output .= "<channel>\n"; $xml_output .= "\t\t<title>Ellucid Movies</title>\n"; $xml_output .= "\t\t<link>http://google.com</link>\n"; for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){ $row = mysql_fetch_assoc($resultID); $xml_output .= "\t<item>\n"; $xml_output .= "<title>" . $row['name'] .".m4v" . "</title>\n"; $xml_output .= "<link>" . $row['link'] . "</link>\n"; $xml_output .= "\t<media:content url='" . $row['name'].".m4v" . " type='video/mpg' />\n";$xml_output .= "\t</item>\n"; } $xml_output .= "</channel>"; echo $xml_output; \[/code\]when i comment out the media content the xml works as expected... when i add the media it does nothing.
 
Back
Top