I have a table and I want to check once in a day if some records have been added or removed from this table within last 24hours ,and then send an e-mail to myself of all those added or removed records only .
Firstly you need to log some table data to compare in future.
Lets say primary key of table.
Create one table table_log which will have all primary key.
id primary_key datetime
1 12,13,14,16,19,20,21 timestamp
2 12,13,14,19,20,21,22,23 timestamp
Now make one php script which will be set in cron job.
Task of php script is as below:
It takes last entry from table_log and export primary_key by ','
Then make a loop to compare with existing table primary_key.
Based on that you can check whether record is deleted or added and you can make an email for that.
Lastly take all primary key from you table and implode it and insert into table table_log for next compare.
Thanks a lot for the reply, but m a little new to php/sql. so would you mind telling me please , how can we set a loop to check two tables against each other using a primary key id ? as you stated in your solution?
Thanks a lot for writing this much long code just for me. I think that you have also solved my problem in past as well. My this problem is also solved.
thanks a lot, i wish i could send you a cup of coffee on daniweb. :-)