this code doesnt work....it doesnt get the information from the row to the text field automatically
<HTML>
<?php
if($submit)
{
$db = mysql_connect("localhost", "xxxxx","xxxx");
mysql_select_db("xxxxxx",$db);
$sql = "INSERT INTO amx_regusers (nick, pass, flags)
VALUES ('$nick','$pass','$flags')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
}
else if($update)
{
$db = mysql_connect("localhost", "boyem","xxxxx");
mysql_select_db("boyem_com",$db);
$sql = "UPDATE amx_regusers SET nick='$nick',pass='$pass',flags='$flags'WHERE nick=$'nick'";
$result = mysql_query($sql);
echo "Thank you! Information updated.\n";
}
else if($id)
{
$db = mysql_connect("localhost", "boyem", "xxxxx");
mysql_select_db("boyem_com",$db);
$result = mysql_query("SELECT * FROM amx_regusers WHERE nick=$'nick'",$db);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Nick:<input type="Text" name="nick" value="<?php echo $myrow["nick"]?>"><br>
Pass:<input type="Text" name="pass" value="<?php echo $myrow["pass"]?>"><br>
Flags:<input type="Text" name="flags" value="<?php echo $myrow["flags"]?>"><br>
<input type="Submit" name="update" value="Update information"></form>
<?
}
else
{?><form method="post" action="<?php echo $PHP_SELF?>">
Nick:<input type="Text" name="nick"><br>
Pass:<input type="Text" name="pass"><br>
Flags:<input type="Text" name="flags"><br>
<input type="Submit" name="submit" value="Enter information"></form>
<?
}
?>
</HTML>
any ideas