I'm doing the cliched employee database tutorial...
The script displays the names of all the employees in the database, and when you click on a name, it should replace the list with a form (first,last,address,position) with the employee's information populating the form fields so that you can edit it. unfortunately, im having trouble echoing anything inside the form fields. the php inside the value field of the form code seems to not be recognized. this is the code:
<?php
... //preceding code
if($id) {
//process the form
$sql = "SELECT * FROM employees WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF ?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
First name:<input type = "Text" name = "<?php echo $myrow["first"] ?>"><br>
Last name:<input type = "Text" name = "<?php echo $myrow["last"] ?>"><br>
Address:<input type= "Text" name = "<?php echo $myrow["address"] ?>"><br>
Position:<input type="Text" name = "<?php echo $myrow["position"] ?>"><br>
<input type="submit" name="submit" value="Enter Information">
</form>
ive tried echo simple strings, like blah and hello, but it wont show up in the field when i run the script in my browser. any suggestions?