check when last password changed in my user db/table
I think you should be doing something like this.


Maintain username,password in separate table like 'password_change_history'
Compare the separate table password with  rm_users password for each user

2.1 if the password is not same -  changed - perform the following task.

  2.1.1 - send sms
  2.1.2 - update password_change_history with latest password for that user.



You can even add date_time column for last password change, counter for how many times changed...extra , so the new table will act as extra meta information table.

You also need to check if any new user is added or any user is deleted.