I'm assuming that your HTML and PHP are in the same file, so going from the DB to your form would look something like this:
<?php
//connect to database here
$id = $_REQUEST['id'];
//Assuming that the ID has to be a number. If not , take the following lines out,
//but make sure you verify that the ID is SQL safe.
if ( !is_numeric($id) ) {
exit( 'invalid ID');
}
$sql_query = "SELECT * FROM myTable WHERE id={$id}";
$result = mysql_query($sql_query);
$row = mysql_fetch_assoc($result);
?>
<form action="?" method="POST">
First Name: <input type="text" name="first_name" value="<?php echo htmlspecialchars($row['first_name']); ?>" />
<br />
Last Name: <input type="text" name="last_name" value="<?php echo htmlspecialchars($row['last_name']); ?>" />
</form>
essentially, you just need to set the value attribute to the value you pulled from the DB. Pass it through htmlspecialchars first or you'll run into problems with double quotes.