I din't read your code - it's irrelevant.
Read the error message carefully! It tells you use an old MySQL driver extension of PHP and tells you should use the new one as the old may be removed in future PHP distributions...
The only different is that you should write
mysqli_connect
instead of
mysql_connect
, and the same for other methods...
http://php.net/manual/en/book.mysqli.php[
^]