In connection with the BD, you are passing a "variable" $123
, but variable names in PHP cannot start with numbers and in this case it is not even being declared. I think you wanted to write $senha
. The same goes for $servidor
and $usuario
.
$link = mysql_connect($servidor, $usuario, $senha);
Also, I don’t know what version of PHP you’re using, but mysql_connect
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 mysqli_connect
You can use mysqli_connect
(note the i next to the word mysql - i is of improved/improved).
$link = mysqli_connect($servidor, $usuario, $senha, $banco);
Optionally, you can use mysqli_select_db
to connect to the BD. In this case, do not add the parameter $banco
in mysqli_connect
.
MORE FUNCTIONS
You can search for more functions in the PHP documentation here.
There is even the option to use the class mysqli
(object orientation).
Hello Aleeh, Welcome to the forum. I suggest you read the tour (https://answall.com/tour) to see how things work here in the community. So that the people can help you here are 2 tips: Put the code through the shortcut
ctrl + k
and not an image. Another tip is to clarify what your problem is.– Evilmaax