I am trying to update the data from my database but they don't show up when I go to the edit page. Any help? Thank you.
index.php
<?php
    include_once('db.php');
    if(isset($_POST['description']))
    {
        $description = $_POST['description'];
        if(mysql_query("INSERT INTO about VALUES('','$description')"))
            echo "Sucacessful Update";
        else
            echo "Please try again";
    }
            $res = mysql_query("SELECT * FROM about");
?>
<form action = "." method="POST">
Name <input type = "text" name="description"><br/>
<input type="submit" value="Save">
</form>
<?php
    while( $row = mysql_fetch_array($res) )
        echo "$row[id]. $row[description] <a href='edit.php?edit=$row[description]'>edit</a><br />";
?>
edit.php
<?php
    include_once('db.php');
    if( isset($_GET['edit']) )
    {
        $id = $_GET['edit'];
        $res= mysql_query("SELECT * FROM about WHERE id='$id'");
        $row= mysql_fetch_array($res);
    }
    if( isset($_POST['newDescription']) )
    {
        $newDescription = $_POST['newDescription'];
        $id      = $_POST['id'];
        $sql     = "UPDATE about SET description='$newDescription' WHERE id='$id'";
        $res     = mysql_query($sql) 
                                    or die("Could not update".mysql_error());
        echo "<meta http-equiv='refresh' content='0;url=index.php'>";
    }
?>
<form action="edit.php" method="POST">
Name: <input type="text" name="newDescription" value="<?php echo $row[1]; ?>"><br />
<input type="hidden" name="id" value="<?php echo $row[0]; ?>">
<input type="submit" value=" Update "/>
</form>
The name from my table is about and I have two columns which are id and description. The one that I'm trying to do here is to edit the description column through php.
 
     
    