Pages

MySQLi and PDO_MySQL library

The entire ext/mysql PHP extension, which provides all functions named with the prefix mysql_, is officially deprecated as of PHP v5.5.0 and will be removed in the future.

It was originally introduced in PHP v2.0 (November 1997) for MySQL v3.20, and no new features have been added since 2006. Coupled with the lack of new features are difficulties in maintaining such old code amidst complex security vulnerabilities.

The manual has contained warnings against its use in new code since June 2011. As the error message suggests, there are two other MySQL extensions that you can consider: MySQLi and PDO_MySQL, either of which can be used instead of ext/mysql. Both have been in PHP core since v5.0, so if you're using a version that is throwing these deprecation errors then you can almost certainly just start using them right away—i.e. without any installation effort.

I have collected some of above said library for your reference.

SimplePDO Database Wrapper
SimpleMysqli
Custom php mysqli database class
MeekroDB
A Simple PHP Class For Prepared Statements in MySQLi