On the original where I stored the data in session array, all data are complete when I fetch it but when I call that session on the other some data is null or undefined.
I don't know what I'm going to do, please help
Edit: In original file
$query = $dbh->prepare("Select p.start_date,p.end_date,dfp.id,dfp.product_id
dfp.type,dfp.quantity_required,dfp.less,pd.unit,pd.name
from promo p
inner join discounts_free_products dfp
on p.id=dfp.promo_id
inner join products pd
on dfp.product_id=pd.id
where DATE(p.end_date) >= DATE(NOW())
");
$query->execute();
$count=0;
$queryresult_set=array();
$queryresult_set=$query->fetchAll();
$count=count($queryresult_set);
$_SESSION['COUNT_PROMO']= $count;
$_SESSION["PROMO_PRODUCTS"]=$queryresult_set;
In other php file
foreach($_SESSION["PROMO_PRODUCTS"] as $result) {
$pc_list[] = $result["product_id"];
$d_id=$result['id'];
}
error:Undefined index: product_id