表格不会更新,但显示成功

I am new to MYSQL

When i try to update a database, the result is showing successful, but the item is not showing. Please can someone help. I have tried carrying it over, by turning the post into a session variable, but made no difference.

update_ac.php

                $name = $_POST['name'];
            $lastname = $_POST['review'];

            // Connect to server and select database.
            mysql_connect("$host", "$username", "$password")or die("cannot connect");
            mysql_select_db("$db_name")or die("cannot select DB");

            // update data in mysql database
            $sql="UPDATE reviews SET name='$name', review='$lastname' WHERE id='$id'";
            $result=mysql_query($sql);

            // if successfully updated.
            if($result){
            echo "Successful";
            echo "<BR>";
            echo "<a href='list_reviews.php'>View result</a>";
            }

            else {
            echo "ERROR";
            echo "Welcome ". $_POST['name']. "<br />";
            echo $lastname; 
            }

            ?> 

update.php

                // Connect to server and select database.
            mysql_connect("$host", "$username", "$password")or die("cannot connect");
            mysql_select_db("$db_name")or die("cannot select DB");

            // get value of id that sent from address bar
            $id=$_GET['id'];

            // Retrieve data from database
            $sql="SELECT * FROM $tbl_name WHERE id='$id'";
            $result=mysql_query($sql);

            $rows=mysql_fetch_array($result);
        ?>

        <?php include "includes/header.php"; ?>
                <div id="bodywrap">
                    <div id="leftcol">
                    <h1>Update the form</h1>

        <form name="form1" method="post" action="update_ac.php">
        <label>Name</label>
        <input name="name" type="text" id="name" value="<? echo $rows['name']; ?>">
        <br />
        <label>Review</label>
        <input name="lastname" type="text" id="lastname" value="<? echo $rows['review']; ?>" size="15">
        <br />
        <input name="id" type="hidden" id="id" value="<? echo $rows['id']; ?>">
        <br />
        <input type="submit" name="Submit" value="Submit">
        </form>

        <?php
        // close connection
        mysql_close();
        ?>
$name = $_POST['name'];
$lastname = $_POST['review'];

Did you notice you used $id and not $_POST['id'] or $_REQUEST['id'] or $_GET['id']? Missing this:

$id = $_POST['id'];

The SQL worked because it DID update on every id='' it found, so it was not an error.

Also, as others pointed out, use mysqli, mysql extension is dangerous and probably will be deprecated soon