How to register more information in the table [closed]

-8

Here's 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);

It returns me:

  

Error: INSERT INTO diarists (name, rg, address, account, agency,   operation, flag,) VALUES (Natan Martins, 1, 1, 1, 1, 001 - Account   Current of Individual, 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 not solve it, can you help me please?

    
asked by anonymous 28.08.2018 / 17:28

2 answers

0

Please note that the error you submitted immediately after VALUES is missing a quote

  

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server for the right syntax to use near ' o, account, agency, operation, flag) VALUES (' ', N atan Martins', '171' at line 1

Try to do this by putting ". $ variable. '" (double quotes, simple quotes,

Also change ç and ã , because of the problem in the bank. S

$sql = "INSERT INTO diaristas (nome, rg, endereco, conta, agencia, operacao, bandeira, DataCadastro) VALUES ("'.$nome.'", "'.$rg.'", "'.$endereco.'", "'.$conta.'", "'$agencia."', "'.$operação.'", "'.$bandeira.'")";

    
28.08.2018 / 18:29
1

A parameter is missing in VALUES. You put a comma, but you did not put the

    
28.08.2018 / 20:18