https://phpgurukul.com/?p=6493
How to maintain the password history using php and mysql