Hi,
I am having the table of the following details.

rollno subject standard
reg01 maths III
reg01 physics III
reg01 english III

This reg01 student has registered this courses. He can make changes this registered courses. How can i find the "updation"(or differences) of my table as the previous using php. No changes means ...the master should not get updation. If any changes means, the request should me sented. How to find it this ? Please help me out thanks in advance.

Recommended Answers

All 5 Replies

wouldn't you put a timestamp in the table and set its ON_UPDATE status so that anytime the row is modified the timestamp gets set to the current time?

then you could check that timestamp against the timestamps in the master.

but the bigger question is why are you having to update a 2nd table? That's sounds like a dangerous database design that will eventually cause you some big problems!

Hi,

you misunderstood my questions. Once again please read this. I am having only a single table.


I am having the table of the following details.

rollno subject standard
reg01 maths III
reg01 physics III
reg01 english III

This reg01 student has registered this courses. He can make changes this registered courses. How can i find the "updation"(or differences) of my table as the previous using php. No changes means ...my teacher should not get any request. If any changes means, the request should me sented. How to find it this ?

Then you would need two timestamps.

one timestamp would be the baseline (date/time of the last time you checked the table) and when you check it, you update this date/time.

one timestamp would be the users change (date/time when user changed a class). this timestamp would be automatically updated by the database (mysql?) when the row is changed.

No,
in simple words, i need to find the differences of my table. (current - before ) using php

If what you are looking for is what did the table look like before changes made by the user then you need to approach the problem differently.

Try drawing a data map. Show us what your table looks like before changes, what it will look like after changes and what the change was. Three simple diagrams.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.