In DB connection, you are passing a% variable of%, but variable names in PHP can not start with numbers, and in this case, it is not even being declared. I think you wanted to write $123
. The same happens with $senha
and $servidor
.
$link = mysql_connect($servidor, $usuario, $senha);
Also, I do not know which version of PHP you are using, but $usuario
was deprecated in version 5.5.0 and removed in version 7.0.0. From documentation :
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0
FUNCTION mysql_connect
You can use mysqli_connect
(note i next to the word mysql - i is improved / improved).
$link = mysqli_connect($servidor, $usuario, $senha, $banco);
Optionally, you can use mysqli_connect
to connect to the DB. In this case, do not add the parameter mysqli_select_db
to $banco
.
MORE FUNCTIONS
You can search for more functions in the PHP documentation here .
There is even the option to use the class mysqli_connect
(object orientation).