Obsolete MySQL: do not use mysql functions * *
The MySQL library, which includes functions such as mysql_connect, mysql_query, and the like, does not allow you to use new MySQL features such as triggers, stored procedures, and more. These features are only available with the use of the MySQLi library.
The MySQLi extension has existed since PHP 5.0, which was released on July 13, 2004. Since then, it was already recommended to use MySQLi instead of MySQL.
However, many programmers continued using (and still use) the MySQL library.
To change this scenario, the PHP team took a rather drastic approach: it removed the MySQL library from PHP 7.
Alternatives to the MySQL extension
Use the MySQLi extension instead of MySQL.
Use the PDO extension (PHP Data Object).
Example using PDO
works on any version of MySQL - test here
/******************** conexão *********************************************
$hostname="localhost";
$username="USUARIO";
$password="SENHA";
$db = "Nome_BD";
$pdo = new PDO("mysql:host=$hostname;dbname=$db", $username, $password);
**************************************************************************/
$sql= "SELECT login, pontos FROM usuarios order by pontos DESC limit 1";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$obj = $stmt->fetchObject();
echo $obj->login;
echo $obj->pontos;