Question: i have a little problem here. No error notice showing, but the data is not inserted / updated into database. Can anybody tell me why? 

Here is my code:

```
$perbandingan = mysql_query("SELECT * FROM ar_produk_detail WHERE id_produk = '$_GET[id]'");
    $rows = mysql_num_rows($perbandingan);
    while($w = mysql_fetch_array($perbandingan)){
        $w_id[] = $w['id_subkategori'];
        $p_id[] = $w['id_produk_det'];
    }

    $data = $_POST['checkbox'];
    $sum = count($data);

    for ($r = 0; $r < $sum; $r++){
            if($w_id[$r] != $data[$r]){
                $do = "UPDATE FROM ar_produk_detail SET id_subkategori = '".$data[$r]."' WHERE id_produk_det = '".$p_id[$r]."'";
                mysql_query($do); //Hapus yang tidak sama / tidak terpilih
                echo $do;
        }
    }

```

Answer: 
It should not be 

```
UPDATE FROM ar_produk_detail SET id_subkateg

```

But

```
"UPDATE  ar_produk_detail SET id_subkateg = '".$data[$r]."' WHERE id_produk_det = '".$p_id[$r]."'";

```

You do not need FROM in UPDATE query.
$do = "UPDATE FROM ar\_produk\_detail SET id\_subkategori = '".$data[$r]."' WHERE id\_produk\_det = '".$p\_id[$r]."'";

Look in update query you using "FORM", that is incorrect.

correct syntax
UPDATE table\_name SET column1=value1 WHERE some\_column=some\_value;

so you must remove "FROM" from your query
 $do = "UPDATE ar\_produk\_detail SET id\_subkategori = '".$data[$r]."' WHERE id\_produk\_det = '".$p\_id[$r]."'";