RSS for a site using php to display info from a DB?


I’m trying to set up an RSS feed for, hosted by DreamHost, and not sure how to go about it.

The site has php scripts that extract various fields related to upcoming bike rides from a SQL database and display text on a page using PHP print statements. See

Is there an easy way (or any way) to provide an RSS feed for this information? Ideally I’d like to structure the RSS feed to preserve the database field names so I can structure them in an iOS app.


You don’t mention how proficient you are with PHP.

Take a lot at this: Creating a Custom RSS Feed with PHP and MySQL

Edit: Also found a library at PHP Universal Feed Generator (supports RSS 1.0, RSS 2.0 and ATOM)

But it appears there are patches in the comments for correcting a couple of bugs.

Rather rusty in php but coming back up to speed.

Thanks for the two links, lots to look into there.


Two followup questions: which flavor of RSS does DreamHost support? And what do I need to do to enable it on the site

Thanks again,

In general, all of them, since RSS is basically just text.

You need to create text files that follow the RSS and XML specifications and upload them, or install/develop server-based software that does it for you, like CGI scripts. You could probably even modify these PHP scripts you already have if their license allows it.