Following is my view I am catching the data from the model and displaying on the view using flashdata in codeigniter
My Controller cart.php
public function coupon(){
for ($i = 0; $i <= $this->input->post("products_in_cart"); $i++) {
if (!empty($this->input->post("coupn-" . $i))) {
$couponname = $this->input->post("coupn-" . $i);
$products_id = $this->input->post("product_id" . $i);
$data = $this->home_model->getCoupon($couponname, $products_id);
$data1 = 'hello';
$info = array(
"PromotioanlName" => $data->PromotionalName,
);
} else {
$info = 'Thers in no value<br>';
}
}
echo $this->session->set_flashdata('message', $info);
redirect(site_url('cart'));
}
My view cart.php
$message = $this->session->flashdata('message');
print_r($message);
But my problem is that my data is overwritten by the next value