caine Posted February 4, 2007 Share Posted February 4, 2007 I'm currently working on creating the xml feed since I had data ready in my database after web data extraction. However, it has errors for this line: <xml version="1.0" encoding="ISO-8859-1"> But my code seems no problem anyway? <html> <head> <title>MMU RSS FEED</title> </head> <body> header("Content-type: application/xml"); <xml version="1.0" encoding="ISO-8859-1"> <rss version ="2.0"> <channel> <title>MMU RSS FEED Today: <?php echo date("D, d-M-Y H:i:s")?></title> <link>http://bulletin.mmu.edu.my/</link> <description>MMU RSS FEED</description> <ttl>60<ttl> <?php //connect to database $db = mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("bulletin", $db) or die(mysql_error()); $day = date("Y-n-j"); //select queries $sql = "SELECT * FROM `bul_data` WHERE `DATE` LIKE '{$day}%' ORDER by `DEPARTMENT`"; echo "sql=".$sql; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res)>0) { while($row=mysql_fetch_assoc($res)) { $date = $row['DATE']; $title = $row['TITLE']; $department = $row['DEPARTMENT']; $link = $row['LINK']; //output to browser echo "<item>"; echo "<title>$title</title>"; echo "<category>$department</category>"; echo "<link><a href=\"$link\">$link</a></link>"; echo "</item>"; } echo "</table>"; } ?> </channel> </rss> </body> </html> Link to comment https://forums.phpfreaks.com/topic/37039-creating-rss-xml/ Share on other sites More sharing options...
trq Posted February 4, 2007 Share Posted February 4, 2007 <?php header("Content-type: application/xml"); ?> Link to comment https://forums.phpfreaks.com/topic/37039-creating-rss-xml/#findComment-176858 Share on other sites More sharing options...
ShogunWarrior Posted February 4, 2007 Share Posted February 4, 2007 <?xml version="1.0" encoding="ISO-8859-1"> Link to comment https://forums.phpfreaks.com/topic/37039-creating-rss-xml/#findComment-176871 Share on other sites More sharing options...
caine Posted February 5, 2007 Author Share Posted February 5, 2007 Both not working as well. ??? Link to comment https://forums.phpfreaks.com/topic/37039-creating-rss-xml/#findComment-177249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.