I'm using mysqli and I can not save information in the database.
I took the test with
echo var_dump($_SESSION);
echo "<br />";
echo $_SESSION['login'];
Return value 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 have not put all the variables to summarize and so the purpose of this post is to pass $ _Session to the Form and save it to the bank.