I am currently using a script to run RSS feeds and dump all data into a MySQL. Every time I run it, it creates a duplicate entry into a database. Is there any way, I can just program a script to only get new feeds?

I have some feeds subscribed on the microsoft outlook and it shows me new feeds as if its a new email. When outlook can handle such thing, I guess my script can handle it too.

6 Years
Discussion Span
Last Post by HITMANOF44th

Both RSS 2.0 and Atom use GUID and ID to identify unique items/entries inside the feed, use those values associated with each source to check what you have already included.

Bye :)

Edited by cereal: n/a

mysql_query("INSERT INTO data values('$title','$link','$description','$myDate')");

Thanks for your help!

// check db to see if the record is there
$sql="SELECT * FROM `data` WHERE (`title` = '$title' AND `description` = '$description') AND `date` = '$mydate' ";
//count results
if($count == 0){
//if record doesnt exist add it
mysql_query("INSERT INTO data values('$title','$link','$description','$myDate')");


also i dont know what your data looks like you might want to use
addslashes(); in case it has special characters

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.