如何使用php编辑/更新mysql中的数据

I've been researching everywhere regarding this matters and i still cant edit/update my entry. Noted, this is my first real program and my level is somewhat mediocre. So i would like to seek your advise/help regarding this matter.

CODE:

<?php
include('config.php');
if(isset($_POST['edit']))
{
    $sql = "select * from hotels where BIL =" .$_GET['edit'];
    $result = mysqli_query($link, $sql);
    $row = mysqli_fetch_array($result);
}

if(isset($_POST['submit'])){
    $hotel = $_POST['hotel'];
    $address = $_POST['address'];
    $update = "update hotels set $hotel = 'hotel', $address = 'address' where BIL = ".$_GET['edit'];
    $up = mysqli_query($link, $update);
    if (isset($sql)){
        die ("Error $sql" .mysqli_connect_error());
    }
    else 
    {
        header ("location: view.php");
    }
}
?>
<html>
<body>
<form method="post" >
New Hotel: <br  />
<textarea name="hotel" cols="50" rows="2" value="<?php echo $row['hotel']; ?>" /></textarea>
<br />
Address: <br / >
<textarea name="address" cols="50" rows="10" value="<?php echo $row['address']; ?>" /></textarea><br /><br />
<input type="submit" name="submit" value="update" />
</form>

<script>
function update(){
    var x;
    if(confirm("update Succesfully") == true){
        x= "update";
    }
}
</script>
</body>
</html>

Extra note: I copied this code from a youtube channel... https://www.youtube.com/watch?v=jQzRDwY6zPc Thanks in advance!