python - How to check if data has already been previously used -


i have python script retrieves newest 5 records mysql database , sends email notification user containing information. user receive new records , not old ones. can retrieve data mysql without problems... i've tried store in text files , compare files but, of course, text files containing freshly retrieved data have 5 records more old one.

so have logic problem here that, being newbie, can't tackle easily.

using lists idea stuck in same kind of problem.

the infamous 5 records can stay same 1 week , can have new record or maybe 3 new records day.

it's quite unpredictable more or less should behaviour.

thank time , patience.

are assigning unique incrementing id each record? if are, can create separate table holds id of last record fetched, way can retrieve records ids greater id. each time fetch, update table new latest id.

let me know if misunderstood issue, saving last fetched id in database solution.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -