0
Well I’m developing an IT inventory besides giving some error , when inserting an 80 hard drive it only saves the zero and the other data is not entered either. how can I fix this .
That is the code
<form method="post" action="cadastrando.php" onSubmit="">
<fieldset>
<legend>Sistema de Inventário</legend><br />
<label class="borda">Setor: </label>
<input class="form_inp" type="text" name="setor" size="30" required><br />
<label class="borda">Usuário:</label>
<input class="form_inp" type="text" id="usuario" name="usuario" size="30" required><br />
<label class="borda">O/S :</label>
<input class="form_inp" type="text" name="os" size="30" required><br /><br />
<label class="borda">Hd : </label>
<input class="form_inp"type="text" name="hd" size="30" required><br />
<hr />
<label class="borda">Memória:</label>
<input class="form_inp" type="text" id="" name="memoria" size="30" required><br />
<label class="borda">Processador: </label>
<input class="form_inp" type="text" id="processador" name="processador" size="30" required><br /><br />
<hr />
<label class="borda">Cd/Dvd: </label>
<select class="form_inp" name="cd">
<option value="Sim">Sim</option>
<option value="Não">Não</option>
</select>
<br />
<label class="borda">Placa Mãe: </label>
<input class="form_inp" type="text" id="placam" name="placam" size="30" required><br />
<label class="borda">HostName: </label>
<input class="form_inp"type="text" id="host" name="host" size="30" required><br /><br />
<label class="borda">Monitor/Patrimônio/Marca/Modelo: </label>
<input class="form_inp" type="text" id="monitor" name="monitor" size="30" required><br />
<label class="borda">Nobreak/Patrimônio/Marca/: </label>
<input class="form_inp" type="text" id="nobreak" name="nobreak" size="30" required><br />
<label class="borda">Placa de Rede : </label>
<input class="form_inp" type="text" id="placar" name="placar" size="30" required><br />
<label class="borda">Placa de Vídeo: </label>
<input class="form_inp" type="text" id="placav" name="placav" size="30" required><br />
<hr />
<input type="submit" style="float: right;" value="Cadastrar" >
<input type="reset" style="float: right;" value="Limpar">
</fieldset>
</form>
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
print_r($_POST);
$setor=$_POST['setor'];
$usuario=$_POST['usuario'];
$hd=$_POST['hd'];
$memoria=$_POST['memoria'];
$processador=$_POST['processador'];
$cd=$_POST['cd'];
$placam=$_POST['placam'];
$host=$_POST['host'];
$monitor=$_POST['monitor'];
$nobreak=$_POST['nobreak'];
$placar=$_POST['placar'];
$placav=$_POST['placav'];
$sql="INSERT INTO setor(setor,usuario,hd,memoria,processador,cd,placam,host,monitor,nobreak,placar,placav) VALUES('$setor','$usuario','$hd','$memoria','$processador','$cd','$placam','$host','$monitor','$nobreak','$nobreak','$placav')";
$resultado_cadastro = mysqli_query($link,$sql);
}
?>
And another mistake that give is the following , why is giving this error if it is all right , I will be grateful.
The errors left are not doing the data Insert . updated the code above .
– allan araujo
I haven’t changed and I’ve confirmed your answer
– allan araujo
You should ask another question with everything relevant to your connection and the way you are entering the data, no need to put HTML. I will try to help @allanaraujo , here it no longer makes sense and I can understand why, not to be inserting. Is there an error? You have the variable
$link
okay?– Miguel
I’ll do it. and I’ll put all the code
– allan araujo
@allanaraujo, html you do not need, if you are already receiving the data, do this test that I tell you above to test it. But if you see the data you filled in the form don’t put the html you don’t need
– Miguel
I already asked the question.
– allan araujo