In addition to cereal's answer, if you send a new random password, you may want to expire it quickly to prevent the user forgetting to change it, and others hijacking it.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
Try by send a reset password link to the user by email...
shahbaz13
Junior Poster in Training
52 posts since Jul 2011
Reputation Points: 10
Solved Threads: 4
You can add an expiry timestamp in your table. If it is filled with a date, then you must check it. After resetting you can set it to NULL.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
Exactly. Am sure you can get what you want.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875