0
Connection to phpmyadmin HOST (n code wanted to go):
connection code to send to the databank:
<?php
include_once("conexao.php");
$usuario = $_POST['usuario'];
$senha = $_POST['senha'];
$email = $_POST['email'];
$sql = "INSERT INTO usuario (usuario, senha, email ) VALUES ('$usuario', '$senha', '$email')";
$salvar = mysqli_query($conexao, $sql);
mysqli_close($conexao);
?>
Totally new to this subject, any help would be greatly appreciated.
The problem does not appear to be in the connection to the database, but rather that you are running the code without sending the data in the request via POST. The errors that appear are that the indexes you are searching for in the POST associative array do not exist.
– João Pedro Henrique
Actually as reported in the comment above, it does not display database connection error (even because you stop running with the snippet
or die ('Não foi possível conectar');
and that he was unable to identify the index variables$usuario = $_POST['usuario']; $senha = $_POST['senha']; $email = $_POST['email'];
. That is, you are not getting the value of these variables or there is some problem in trying to capture these data that are apparently being sent. I recommend to post the fron-end code from where you send this data.– Luiz Fernando