j'aimerai créer une session à partir d'un INT dans mysql en l’occurrence ici avec "numero_calcul".
Jusqu'a maintenant j'arrive à créer ma session grâce à "sChi1 " qui est un $_POST
comme ceci :
Ccalcul.php
function calcul_box()
{
$sChi1 = $GLOBALS['MySQL']->escape($_POST['n1']);
$sSi1 = $GLOBALS['MySQL']->escape($_POST['si1']);
$sChi2 = $GLOBALS['MySQL']->escape($_POST['n2']);
$sVotresultat_1 = $GLOBALS['MySQL']->escape($_POST['result']);
$sVotre_temps = $GLOBALS['MySQL']->escape($_POST['chronotime']);
if ($sChi1 != "" && $sSi1 != "" && $sChi2 != "" && $sVotresultat_1 != "" && $sVotre_temps != "")
{
$bRf = $GLOBALS['MySQL']->res("INSERT INTO `addition` SET
`chiffre1` = '{$sChi1}',
`signe1` = '{$sSi1}',
`chiffre2` = '{$sChi2}',
`votresultat` = '{$sVotresultat_1}',
`chronotime` = '{$sVotre_temps}'
"
);
$GLOBALS['CLogin']->performLogin($sChi1);
return ($bRf) ? 1 : 3;
}
}
Clogin.php function performLogin($sChi1) {
$this->performLogout();
// make variables safe
$sChi1 = $GLOBALS['MySQL']->escape($sChi1);
$aProfile = $GLOBALS['MySQL']->getRow("SELECT * FROM `addition` WHERE `chiffre1`='{$sChi1}'");
// $sPassEn = $aProfile['password'];
$iPid = $aProfile['numero_calcul'];
$_SESSION['member_numero_calcul'] = $iPid;
$_SESSION['member_chiffre1'] = $sChi1;
}
Comme "numero_calcul" est un int et n'est pas posté comment le récupérer?Merci de m'éclairer