|
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.
[Back to original message]
|