-8
This is my code:
$nome = $_POST['nome'];
$rg = $_POST['rg'];
$endereço = $_POST['endereço'];
$conta = $_POST['conta'];
$agencia = $_POST['agencia'];
$operação = $_POST['operação'];
$bandeira = $_POST['bandeira'] ;
//insere dados na tabela
$sql = "INSERT INTO diaristas (nome, rg, edereço, conta, agencia, operação, bandeira, DataCadastro) VALUES ($nome, $rg, $endereço, $conta, $agencia, $operação, $bandeira,)";
//confere se cadastrado ou não.
if (mysqli_query($strcon, $sql)) {
echo "Profissional Cadastrado com Sucesso.";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($strcon);
}
mysqli_close($strcon);
He returns to me :
Error: INSERT INTO diarists (name, rg, edereço, account, agency, operation, flag, VALUES (Natan Martins, 1, 1, 1, 001 - Account Corrente de Pessoa Física, BRADESCO,) You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near ' o, account, agency, operation, flag, ) VALUES (Natan Martins, 1, 1, 1,' at line 1
I can’t fix it, can you help me please?
Isn’t the setting for the special characters? it seems to me that he is complaining of the
çin address... tries to delcarar them using a crase before and after the column name– Leandro Angelo
I looked at the characters, I was using ç. I switched everything from variables to parameters including the database to simplify. helped a lot. Thank you!
– Natan Martins Nouzanadam