0
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, I want to register the chairs from number 50 to 69 in the department such. 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 don’t know how to adapt the other fields next to the sequential number. Someone could help me?