I am populating a table using php from an array (populated by an mysql query). The table code I am using is:
<thead>
<tr>
<hr>
<th>UserName</th>
<th>Nick Name</th>
<th>Role</th>
<th>Unit</th>
<th>Active</th>
<th>Admin</th>
</tr>
</thead>
<tbody>
<?php
foreach ($portfolio as $row)
{
echo("<tr>");
echo("<td>" . $row["username"] . "</td>");
echo("<td>" . $row["nickname"] . "</td>");
echo("<td>" . $row["role"] . "</td>");
echo("<td>" . $row["unit"] . "</td>");
echo("<td>" . $row["active"] . "</td>");
echo("<td>" . $row["isadmin"] . "</td>");
echo("</tr>");
}
?>
I have been trying without luck to find a way to have the first column in the table a hyperlink that allows editing of that users details (IE redirects to another page/php). The array itself is being populated using this code:
//now lets get the user's stock info
foreach ($rows as $row)
{
$stock = lookup($row["username"]);
$stock["username"] = $row["username"];
$stock["nickname"] = $row["nickname"];
$stock["role"] = $row["role"];
$stock["unit"] = $row["unit"];
$stock["active"] = $row["active"];
$portfolio[] = $stock;
}
How can I make the results of the sql query / php a link within the table?
Thanks for the help, I am new to php/mysql and trying to find my feet;
Andy