0
I’m using mysqli and I can’t save information in the database.
I ran the test with
echo var_dump($_SESSION);
echo "<br />";
echo $_SESSION['login'];
The value returned was:
array(2) { ["login"]=> string(6) "Djalma" ["password"]=> string(3) "123" }
<?php
session_start();
require '../php/funcao_mysql.php';
$cod_os = $_POST['N_OS'];
$cod_usuario = $_SESSION['login'];
$sql = $con->prepare("insert into ControleOS (cod_os, cod_usuario, cod_cliente, NomeCliente, DataOs, Hora, DescProbl, Tp_Instalacao, MuCaboCliente,
MuCaboBackBone, MuRJ45, MuEmendaBargoa, MuTomada, MuBenjamimAdaptador, MuEsticadorCaboFE, MuRoldanaS, MuRoldanaD, MuAnel, MuFecho,
MuCaixaHermetica, MuBarraAterramento, MuTuboAterramento, MuAntena, MuRadio, TrPing, TrTracert, TrVelocidade, TrCaboCliente, TrPontoRede,
TrRJ45, TrVerificPlacaRede, TrVerificDHCP, TrConfigDiscador, TrConfigRoteador, TrConfigRadio, TrHabilitacaoServico, TrInformacaoChuvas,
TrTelefoneSuporte, TrMudancaPortaBackbone, TrMudancaPortaCliente, TrTreinamentoCliente )
Values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
$sql->bind_param('iiissssssssssssssssssssssssssssssssssssss', $cod_os, $cod_usuario, $cod_cliente, $NomeCliente, $DataOs, $Hora, $DescProbl, //7
$Tp_Instalacao, $MuCaboCliente, $MuCaboBackBone, $MuRJ45, $MuEmendaBargoa, $MuTomada, $MuBenjamimAdaptador, $MuEsticadorCaboFE, //8
$MuRoldanaS, $MuRoldanaD, $MuAnel, $MuFecho, $MuCaixaHermetica, $MuBarraAterramento, $MuTuboAterramento, $MuAntena, $MuRadio, $TrPing, //10
$TrTracert, $TrVelocidade, $TrCaboCliente, $TrPontoRede, $TrRJ45, $TrVerificPlacaRede, $TrVerificDHCP, $TrConfigDiscador, //8
$TrConfigRoteador, $TrConfigRadio, $TrHabilitacaoServico, $TrInformacaoChuvas, $TrTelefoneSuporte, $TrMudancaPortaBackbone, //6
$TrMudancaPortaCliente, $TrTreinamentoCliente); //2
$sql->execute();
$sql->close();
?>
I did not put all variables to summarize and pq the purpose of this post and pass $_Session to the Form and save in the bank.
You can show me how you would?
– fabricio_wm
I disagree with "Recommend exclusion". The explanation is short but there is, the answer is not a simple "Check {link}". @Renatotavares, see the guide [Answer] for more details.
– brasofilo
I agree with you, @brasofilo. Thanks.
– fabricio_wm