<table class="table table-striped table-framed table-centered">
<thead>
<tr>
{foreach from=$columns key=num item=columninfo}
<th><font color="black">{$columninfo.columnname}</font></th>
{/foreach}
<th> </th>
</tr>
</thead>
<tbody>
{foreach from=$rows key=num item=rowinfo}
<tr>
<td><font color="black">{$rowinfo}</font></td>
<td><a href="database.php?action=viewtable&table={$tableinfo.tablename}&database={$currentdatabase}"><input class="btn btn-danger" type="button" value="Delete" onclick="return confirm('Are you sure you would like to delete this row?');"/></td></a>
</tr>
{/foreach}
</tbody>
</table>
I've been trying to make it output all the data in the arrays, but the second array, $rows, does not output anything.
The first one works great, and outputs all the names of the columns.
The second array looks like this.
Array ( [0] => Array ( [ID] => 3 [Name] => Eirik [Age] => 20 ) )
What I'm trying to do is to create a database management system where you can access your databases and see tables, columns and rows. Currently I'm only missing rows to complete. It fetches all the column names, and makes the table header, then goes over to rows. The problem here is that when I'm trying to print the rows into the table, I can't use the column name to access the array, due to the column names being different for every database.