Test
<?php
if($_POST['ret']){
$db = mysql_connect("localhost","***","***");
mysql_select_db ("***" , $db);
$sql = mysql_query("SELECT * FROM guestbook WHERE id = $id2bedited");
while($row = mysql_fetch_array($sql)) {
echo "<input type=text name=navn value=".$row['navn']." size=40>";
echo "<br>";
echo "<input type=text name=emne value=".$row['emne']." size=40>";
echo "<br>";
echo "<textarea cols=30 rows=15 name=besked>".$row['besked']."</textarea>";
echo "<br>";
}
if($_POST['gem']){
$db = mysql_connect("localhost","***","***");
mysql_select_db ("***" , $db);
mysql_query ("INSERT INTO guestbook (navn,emne,besked) values('$navn','$emne','$besked') WHERE id = $id2bedited");
}
}
?>
<form method="post" action="<?php print $_SERVER['PHP_SELF'] ;?>"><br>
<p>
ID:<br>
<input type="text" name="id2bedited" size="10"><br>
<input type="submit" name="ret" value="Ret besked"><br>
<input type="submit" name="gem" value="Gem">
</p>
</form>