Someone could help me with this problem. follow the code:
<?php
$equipamento = $_POST['equipamento'];
$departamento = $_POST['departamento'];
$observacao = $_POST['observacao'];
$NInicial = $_POST['NInicial'];
$NFinal =$_POST['NFinal'];
$data=date('Y-m-d ');
$valores = range( $NInicial, $NFinal );
$sql = sprintf( 'INSERT INTO equipamentos(numero) VALUES (%s)', implode( '), (' , $valores ) );
// CASO ESTEJA TUDO OK ADICIONA OS DADOS, SENÃO MOSTRA O ERRO
if (!mysqli_query($mysqli,$sql))
{
die('Error: ' . mysqli_error($mysqli));
}
// MOSTRA A MENSAGEM DE SUCESSO
echo "1 record added";
mysqli_close($mysqli);
?>
Each chair has a number, for example I want to register the seats from number 50 to 69 in such department. With this in the bank will generate 20 records with this sequence of numbers with the name of the equipment and department. The problem is that I can not adapt the other fields next to the sequential number. Could someone help me?