I want to share a piece of code, 'few' or 'most' people usually have issues creating--->A dynamic rss feed.
Dynamic means-- fetching articles from the database.
Instead of you updating the rss manually.
Like a month back, some guy was here having issues with it, I don't know if I helped with his issue, because I never really ran the codes on my machine.
Until one day I decided to try, and I discovered why he had issues.
Now I'll be using Mysqli queries first,
Then I'll put up the Mysql query syntax for those still using mysql in a comment(//) below the mysqli syntax.
Ok to cut the story story...
Here's the code.
//first include your database connection //setup
//lets call it include_database.php
//now let's set the header content to xml
//because we won't be saving the file with
//the extension .xml instead it will be .php
//That is dynamic_rss.php
echo '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'."
<description>Dynamic Website Rss Feed</description>
$query = "SELECT * FROM `articles` LIMIT 30";
//you can change your limit values!
$result = mysqli_query($dbconn, $query);
//if u are still using mysql
//do this $result = mysql_query($query)
//remove the 'i' in the mysqli
While($row = mysqli_fetch_array($result))
echo ' <item><title>'.$row["title"]. '</title>
<pubDate>date of article</pubDate></item>';
I hope this helps!
Feel free to contact me if you have any issues.
Thank you :)