1
I am trying to enter the current date as the person registers but I did not want the user to inform this data but rather to enter it through some function with mysql, to save the date the provider was registered. But I tried some ways and I couldn’t, I looked here on the forum and I couldn’t so I created the question
<?php  
        if(isset($_POST['enviar_for'])){
                $id = $_POST['id'];
                $fornecedor = $_POST['fornecedor'];
                $observacoes = $_POST['observacoes'];
                $data_cadastro = date('Y-m-d', strtotime($_POST['data_cadastro']));
                $sql = "SELECT * FROM cadfor WHERE id_pessoa = '$id' "; 
                $resulta = $conn->query($sql);
                $row = $resulta->fetch_assoc();
                if ($resulta->num_rows > 0 ){
                    $result_endereco = "UPDATE cadfor SET tipo_endereco = '$tipo_endereco', cep = '$cep ', tipo_logr = '$tipo_logr', nome_logr = '$nome_logr', nume_logr = '$nume_logr', comp_logr = '$comp_logr', cidade = '$cidade', bairro = '$bairro', uf = '$uf' WHERE id_pessoa = '$id' ";
                } else {
                    $result_endereco = "INSERT INTO cadfor(id_pessoa, fornecedor, observacoes, data_cadastro) VALUES ('$id', '$fornecedor', '$observacoes', 'NOW()' )";
                }
                $resultado = mysqli_query($conn, $result_endereco);
                echo $result_endereco;
        }
  ?>
						
Remove the quotes from the function
NOW().– Leandro Lima