Entering PHP MYSQLI data

Asked

Viewed 58 times

-1

Guys good night. At this moment I am trying to enter data from a form in the database. However, it is not being inserted at all.

Code form:

<form action="enviar-ponto.php" method="POST">

<input name="nomePonto" value="<?php echo $resultado['nome']; ?>" readonly="readonly">
<input name="cpfPonto" value="<?php echo $resultado['cpf']; ?>" readonly="readonly">
<input name="horarioPonto" value="<?php echo date('H:i:s'); ?>" readonly="readonly">
<?php } ?>

<button> Bate Ponto</button>
</form>

Sending-point code.php

session_start();

include("conexao/conexao.php");


echo "Olá, ".$_SESSION['login']."<BR>";


$nome = $_POST['nomePonto'];
$cpf = $_POST['cpfPonto'];
$horario = $_POST['horarioPonto'];

if($horario > "11:30:00"){

$reck = "INSERT INTO ponto (nome, cpf, horario1, horario2, horario3, horario4) VALUES ('$nome','$cpf','$horario','$horario','$horario','$horario')";

} 

  if(mysqli_query($conexao, $reck)){

    echo "Ponto registrado com sucesso";
  }else{

    echo "Impossível registrar ponto nesse momento";
  }

1 answer

-1

Problem solved. I used the standard PHP error and it returned to me that the field in the database was too short for a long result.

attt

Browser other questions tagged

You are not signed in. Login or sign up in order to post.