Hello I have a PHP function that returns an array of values. Besides this I have a HTML page with PHP inside where I would like to call the function and print values inside a HTML table.
The code looks like this:
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Surname</th>
<th>DOB</th>
<th>Address</th>
<th>E-mail</th>
<th>Phone</th>
<th>Gender</th>
<th>Subscription</th>
<th>Acc. Balance</th>
</tr>
</thead>
<tbody>
<?php
require_once ('database_initialisation.php');
$table = "members";
$array = $admin_query->viewTableData($table);
foreach ($array as $row){
print_r($array);
?>
<tr>
<td> <?php $row[member_id] ?> </td>
<td> <?php $row[member_password] ?> </td>
<td> <?php $row[member_first_name] ?> </td>
<td> <?php $row[member_last_name] ?> </td>
<td> <?php $row[member_DOB] ?> </td>
<td> <?php $row[member_address] ?> </td>
<td> <?php $row[member_email] ?> </td>
<td> <?php $row[member_phone] ?> </td>
<td> <?php $row[member_gender] ?> </td>
<td> <?php $row[member_subscription] ?> </td>
<td> <?php $row[member_account_balance] ?> </td>
</tr>
<?php } ?>
</tbody>
</table>
The print_r is just to see if I can get the actual array, which prints fine the array. Also within the table having the for each, it does generate the number of rows that are needed but it does not put any values inside the TD
Any suggestions would be much appreciated? Thanks