how to compare the result of a same query in different times

hi
I want to connect to my postgresql database and have the number of rows in different times. for example , I want to calculate the number of rows and keep it. then by javascript I run this php codes , I run php codes by javascript codes each 10 seconds and see if the name of recordes has been changed or not.
who can help me in details with an example?
thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service