envexlabs Posted September 12, 2007 Share Posted September 12, 2007 Hey, the mysql forums are dead, so i thought i'd give here a shot Is it possible to check and see if any mysql tables have been updated. ie. if a store has added new products, etc. Thanks, envex Quote Link to comment https://forums.phpfreaks.com/topic/69058-getting-a-list-of-updated-mysql-tables/ Share on other sites More sharing options...
colombian Posted September 12, 2007 Share Posted September 12, 2007 If you are trying to know if it has been updated after running a query, then do: <?php $query = "UPDATE table SET ...."; $result = mysql_query($query); if (mysql_affected_rows() > 0) { // a row was updated, so do what you need // mysql_affected_rows() is probably what you are looking for. } ?> Quote Link to comment https://forums.phpfreaks.com/topic/69058-getting-a-list-of-updated-mysql-tables/#findComment-347111 Share on other sites More sharing options...
envexlabs Posted September 12, 2007 Author Share Posted September 12, 2007 Hey, I'm not to sure if this is what i'm looking for. What i have is a page that renders out all the stores a user has added as favorite. I want to show, if applicable, if a store has updated any of their information. Quote Link to comment https://forums.phpfreaks.com/topic/69058-getting-a-list-of-updated-mysql-tables/#findComment-347115 Share on other sites More sharing options...
liebs19 Posted September 12, 2007 Share Posted September 12, 2007 For that you will probably need to store the date and time that they last updated their information in the database. Also store the last login time for the user in the database. Then just compare the last information update time to the last login time for the user. Quote Link to comment https://forums.phpfreaks.com/topic/69058-getting-a-list-of-updated-mysql-tables/#findComment-347122 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.