I have a class that retrieves a result set from a database. The result is wrapped in arrays which are then stored as session variables as shown in the code
$days = array();
$amount = array();
$commission = array();
foreach ($result as $row) {
array_push($days,$row['sales_day']);
array_push($amount,$row['sales_total']);
array_push($commission,$row['sales_comm']);
$_SESSION['days'] = $days;
$_SESSION['amount'] = $amount;
$_SESSION['commission'] = $commission;
I then attempt to display the data in HTML table as in this code:
<tr>
<td><label><?php print_r($_SESSION['days']); ?></label></td>
<td><label><?php print_r ($_SESSION['amount']); ?></label></td>
<td><label><?php print_r($_SESSION['commission']); ?></label></td>
</tr>
The problem is that the output is something like: array[0] => 1. But I want only the values retrieved from the database to display and not the array indices.