Not sure how to do this. The code below does not work.
From the function getRecords()
$result = mysql_query('SELECT * FROM partners');
return $result;
And this where I want to display
<?php $records = getRecords(); ?>
<table>
<tbody>
<tr>
<td>Partner name</td>
<td>Username</td>
<td>Password</td>
<td colspan="2">Actions</td>
</tr>
<?php
if (isset($records)) {
foreach ($records as $record) {
$row = '<tr>'
. '<td>' . $record['partner']. '</td>'
. '<td>' . $record['username']. '</td>'
. '<td>' . $record['password']. '</td>'
. '</tr>';
echo $row;
}
}
?>
</tbody>
</table>
I hope you get the idea. What am I missing?
1 Answer