You are here: Inserting only new RSS items into a database « PHP Language « IT news, forums, messages
Inserting only new RSS items into a database

Posted by distatica on 04/21/07 02:14

Hello all,

Let me first start by saying I am a PHP newbie, and this may be a
pathetically easy question, I'm not sure.

I am currently retrieving the latest YouTube videos that have been
posted using Magpie RSS Libraries. The script I am writing must then
take those entries and write the YouTube video id, video name,
description and URL to a database for later use. I have a script that
does that no problem; what I am having issues with is how to make sure I
do not add duplicate entries to the database. At first glance I figured
I could just query the MySQL database for each item in the RSS feed, and
see if that Video ID was being used. While I'm sure this will work, it
sounds like a lot of unnecessary php<->mysql interaction. My second
thought was to insert the last known feed from the cache that Magpie
creates into an array, and then the new feed that is fetched into an
array, and then use array_diff() to compare them, but I'm not sure this
will work as I intend. If anyone has experienced a similar problem, or
has any tips for a newbie, I would greatly appreciate them.

Thank you in advance for your time.

Sincerely,
distatica.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация