I have the following resolution, I am not able to register in the bank. I've changed a few things but there are always these errors:
Warning: mysqli_set_charset() expects parameter 1 to be mysqli, resource given in C:\xampp\htdocs\envio\conecta_mysql.inc on line 5
Notice: Trying to get property of non-object in C:\xampp\htdocs\envio\conecta_mysql.inc on line 7
Fatal error: Call to a member function query() on resource in C:\xampp\htdocs\envio\insere.inc on line 17
This is connecta_mysql.inc:
<?php
$conexao = mysql_connect('localhost', 'root', '', 'formulario');
mysqli_set_charset($conexao, 'utf8');
if ($conexao->connect_error) {
die("Falha ao realizar a conexão: " . $conexao->connect_error);
}
?>
This is insere.inc:
<?php
include 'conecta_mysql.inc';
$n_1 = $_POST['n_1'];
$n_2 = $_POST['n_2'];
$n_3 = $_POST['n_3'];
$consultor01 = $_POST['consultor01'];
$consultor02 = $_POST['consultor02'];
$consultor03 = $_POST['consultor03'];
$total_acordos = $_POST['total_acordos'];
$total_parcelas = $_POST['total_parcelas'];
$sql = "INSERT INTO n_acordos VALUES";
$sql .= "('$n_1','$n_2','$n_3','$consultor01','$consultor02','$consultor03','$total_acordos','$total_parcelas')";
if ($conexao->query($sql) === TRUE) {
echo "Informações atualizadas com sucesso!";
} else {
echo "erro: " . $sql . "<br>" . $conexao->error;
}
$conexao->close();
?>