I wrote this script:
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../css/stile.css">
</head>
<body>
<?php
include_once("../../classi/funzioni.php");
include_once("../../classi/config.php");
include_once("../../classi/auth.lib.php");
session_start(); //Inizio la sessione
list($status, $user) = auth_get_status();
if($status == AUTH_LOGGED && $user['nome_negozio']=="Black Fashion"){
echo "<h1>ORDINE DA CLIENTE</h1>";
$prodotto="SELECT * FROM elenco_movimenti WHERE cliente='".$user['nome_negozio']."'";//query
echo "<br><b>QUERY</b><br>";
echo $prodotto;
$prodotto=$db_magazzino->query($prodotto);
$prodotto=$prodotto->fetch_row();
$i=count($_SESSION);
$_SESSION[$i]=$prodotto;
}
?>
<form name="form1" method="post" action="./ordine_da_cliente.php">
<label for="barcode"><b>Codice a barre</b></label>
<input type="text" name="barcode" >
<input type="submit" name="submit" value="OK">
</form>
</body>
</html>
NB
$i=count($_SESSION);
$_SESSION[$i]=$prodotto;
Then if the session has 0 elements, i set $_SESSION[0] width the product, and i see it with var_dump:
VAR DUMP SESSION
array(1) { [0]=> array(14) { [0]=> string(1) "0" [1]=> string(19) "2014-10-12 08:31:18" [2]=> string(18) "Carico da articoli" [3]=> string(13) "0913VLA002001" ETC...
but the next count is always zero and i see the same vardump...
Why don't i see $_SESSION[0][0][1][2]. $_SESSION[1][0][1][2], etcetera?