Im using PHP to parse some XML, I take 3 details from each entry in the XML – Title, Description and ID.
The ID is unique and I store the ID along with title and description in a database. Im running the parse script via CRON so to prevent duplicates I want to first check the database to see if the ID of the entry already exists in the database.
How can I do this?
This will get my all the ID’s right?
$id = mysql_query("SELECT id FROM updates");
$row = mysql_fetch_assoc($id);
if ($entry->id != $row) {
Insert
} else {
echo 'Duplicate';
}
Open to ideas?
Does that give me an array that I can compare the ID in the XML to?
it returns array form, so you have to give it column index or name to match