1
I am creating a data listing system, and created a data change page, with 6 fields, name, experience, email, phone, city and biography. only that my function does not update the fields. The data arrives in the function alter data() but does not update in the database.Only the experience field updates.
function Altera_Dados(){
$retorno="";
$conecta = DBConnect();
if(isset($_POST["atualiza"])){
$Nome = $_REQUEST['DadoNome'];
echo $_REQUEST['DadoNome'];
$experiencia = $_POST['experiencia'];
echo $_POST['experiencia'];
$email = $_POST['email'];
echo $_POST['email'];
$telefone = $_POST['telefone'];
echo $_POST['telefone'];
$cidade = $_POST['cidade'];
echo $_POST['cidade'];
$id = $_POST['id'];
//$biografia = $_POST['biografia'];
$query ="UPDATE cadastro3 SET nome = '$Nome',experiencia='$experiencia',email='$email' where id ='$id'";
$retorno = mysqli_query($conecta,$query)or die ('Erro na consulta ::. '. mysqli_error($conecta));
}
DBClose($conecta);
return $retorno;
}
I used the ID ai the following message appears: mysqli_num_rows() expects Parameter 1 to be mysqli_result, Boolean Given in C: xampp htdocs Constructesfree Dozero System funcoes.php on line 284 Warning: Not updated!
Better yet. This code is extremely insecure. I notice that no one validates anything, no one cares if it’s right, just wants to see it working. Then there is no point in fixing a problem. Actually if solving this problem is worse because the person will think that now is ok.
– Maniero
Now we are on track. there is an error in your query!
– Lollipop