Merge RSS feed with mySQL query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nwr91
Forum Newbie
Posts: 1
Joined: Thu Jan 13, 2011 9:29 pm

Merge RSS feed with mySQL query

Post by nwr91 »

Hello,

I do not have too much expericence with PHP, but i would like to implement a news feed on a website i'm developing. The thing is, the source for the news is a RSS feed and a mySQL query. I'd like to merge both sources, show the 5 most recent news, and sort them by date.

Is there any way to do this at all?

Thanks
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Merge RSS feed with mySQL query

Post by Jade »

One way to do it is to write one script that parses the existing RSS feed and puts it into an array. Then write another script to run your query and put those results in the same array. Finally sort your array by date and display only the top 5 indexes.
Post Reply