1
Guys, I’m trying to insert some data in my comic book, I’ve done this action in other systems and it always worked, but this time it’s not giving, it shows no error message, it just doesn’t include in the bank, I tried to make the Insert in other ways but it didn’t work (the bottom code is the last attempt I made), I gave an echo in sql and he’s right, he just doesn’t add the entries in the bank, the names are all correct, would it help? thanks in advance.
<?php
include_once "conexao.php";
//include_once "defines.php";
//require_once('classes/BD.class.php');
//BD::conn();
if(isset($_POST['prox'])){
$nome = 'Giovani';
$data = strip_tags(trim(filter_input(INPUT_POST, 'data', FILTER_SANITIZE_STRING)));
$sala = '1';
$computador = 's';
$projetor = 's';
$som = 's';
$microfone = 'n';
if (empty($data)) {
echo '<div class="alert alert-danger" role="alert" id="erro">* Atenção, para prosseguir é preciso selecionar uma data. *</div>';
}else{
$sql = "INSERT INTO `agendamento` (`nome`, `data`, `sala`, `computador`, `projetor`, `som`, `microfone`) VALUES ('$nome', '$data', '$sala', '$computador', '$projetor', '$som', '$microfone');";
$qur = mysqli_query($link, $sql);
echo $sql;
}
}
?>
Sorry. Well, you know the previous version Voce used in the banks and the current version ?
– Alex
Read about the function
mysqli_error
– Woss
In the code posted there are no errors, played on my server and worked right. Ask the question the other codes involved in the issue. i.e., connection.php, HTML.
– user60252
I have this connection code:<? php $link = mysqli_connect("localhost", "Admin", "admin", "scheduling equipment") or die ("Error connecting to database!"); ?>
– giovani vrech
The version of the bank is the same that used before
– giovani vrech
I used mysqli_error and it returned this message: incorrect date value: '30/01/2018' for column 'data' at Row 1
– giovani vrech