I need a form that allows a user to edit data from an SQL database.
The main page of my form contains a table where any available data is shown and, also, there are edit and delete options available. Sample:
{
$row=mysql_fetch_array($result);
echo "<tr>";
echo "<td>".$row["name"]."</td>";
echo "<td>".$row["occuptation"]."</td>";
echo '<td><a href="edit.php"><img src="edit.png"/></a></td>';
echo '<td><a href="delete.php"><img src="delete.png"/></a></td>';
echo "</tr>";
}
When the user clicks the edit.png
I need it to direct to edit.php
where the data from the whole row selected (whichever row the user chooses to click edit or delete from) shows up in a form (like default values). I have no idea how to achieve this.
Any help is appreciated! Please tell me if i'm being confusing and I will try to explain further.