Database update in php
<p>I need some help, cause i cant understand why this code dont work... I can select name, price and in_stock from database, but after when i want to update them, dont work it.</p>

<pre><code> include("../db_config.php");
 $tipus=$_POST['tipus'];  
 $meret=$_POST['meret'];  
 $ar=$_POST['ar'];
 $submit=$_POST['sb']; 
 $up=$_POST['up'];


if(!empty($submit) &amp;&amp; !empty($up)){

     $sql[0]="UPDATE products SET tipus='$name',meret='$price',ar='$in_stock' WHERE id= '$up' "; 
        $result = mysqli_query($conn, $sql[0]);  
    if(mysqli_error($conn)) {
        header("Location: news.php?mode=adds&amp;msg=Changes couldn't be saved.");
    }
    else {
        header("Location: /news.php?mode=adds&amp;msg=Changes succesfully saved.");
    }
}
</code></pre>