Update multiple row by get value from check box in php
<p>Could you help me:
I have three table :there are <code>:users(userid,uername,password,groupid),group(groupid,groupname),menus(menuid,menuname),permissions(menuid,gorupid):</code>
I would like update to table:permission
here my coding:</p>

<pre><code>&lt;?php
    require_once("includes/session.php");
    $post = (!empty($_POST)) ? true : false;
    if ($post)
 {

     require_once("includes/connection.php");
     require_once("includes/functions.php");
     //GET value from page user submited
   $groupname = mysql_prep($_POST['groupname']);
   $desc = mysql_prep($_POST['desc']);
   $st_val = mysql_prep($_POST['valstore']);//store as array ex:(1,2,3,4,5,);
  $store_del_exp = explode("," ,$st_val);
  $store_del_exp_count=count($store_del_exp);
  for($j=0; $j&lt;$store_del_exp_count;$j++)
  {
     $t_id = trim($store_del_exp[$j]);
         $groupid = mysql_prep($_POST['groupid']);
          if($t_id&gt;0){
             $sql = "UPDATE permissions SET menus_menuid ='$t_id' WHERE groups_groupid ='".(int)$groupid."'";
            $result = dbQuery($sql);
          }
  }
       if(mysql_affected_rows){
            echo "Successfully";

        }
 }
?&gt;
</code></pre>
