-2
The page loads all right , however the columns are empty in the bank
{
<?php
$servername = "localhost";
$database = "login";
$username = "root";
$passwd = "odair";
$conn = mysqli_connect($servername, $username ,$passwd , $database);
$nome = mysqli_real_escape_string($conn, $_POST["nome"]);
$sobrenome = mysqli_real_escape_string($conn, $_POST["sobrenome"]);
$nascimento = mysqli_real_escape_string($conn, $_POST["bday"]);
$genero = mysqli_real_escape_string($conn, $_POST["gender"]);
$sql = "INSERT INTO 'login'.'dados' ('nome', 'sobrenome','bday','gender') VALUES ('{$nome}', '{$sobrenome}','{$nascimento}','{$genero}'";
mysqli_query($conn , $sql);
mysqli_close($conn);
?>}
tries to take exactly as it is in the code and replace it with real values in a SGBD(Workbench) and see if it is entering.
– Gabriella Selbach
I tried without the keys , and tried to insert real values without being the variables tbm, but without success..
– Odair Lue
$sql = "INSERT INTO
login
.dados
(nome
,sobrenome
,bday
,gender
) VALUES ('Odair', 'silva', '2019-02-25', 'Male')"; That way it worked... but how can I pass the values of the variables ?– Odair Lue