title: how to insert one value to different rows
body: <p>i wanted the code to insert the same value to different rows that are checked in the list(the list is queried from the database.) but it says<br>
  "Notice: Array to string conversion in \enrol.php on line 5",</p>
  
  <p>here is my section.php</p>
  
  <pre><code>    &lt;table border=1px&gt;
      &lt;th&gt;SELECT&lt;/th&gt;
      &lt;th&gt;ID NUMBER&lt;/th&gt;
      &lt;th&gt;NAME&lt;/th&gt;
      &lt;th&gt;COURSE&lt;/th&gt;
      &lt;th&gt;YEAR&lt;/th&gt;
  
      &lt;?php session_start();
      include('connect.php');
      $group=$_REQUEST['idEdit'];
      echo $group;
  
      $sql="SELECT * FROM login WHERE section IS NULL or section = 0";
      $result=mysql_query($sql) or die(mysql_error() );
  
  
          while($arr=mysql_fetch_array($result))
          {
              echo '&lt;tr&gt;&lt;td&gt;&lt;form action="enrol.php" method="post"&gt;&lt;input type="checkbox" name="idnumber[]" value="'.$arr['idnumber'].'"&gt;&lt;/td&gt;'.
                   '&lt;td&gt;'.$arr['idnumber'].",&amp;nbsp&lt;/td&gt;".
                   '&lt;td&gt;'.$arr['lastname'].",".$arr['firstname']."&amp;nbsp&lt;/td&gt;".
                   '&lt;td&gt;'.$arr['course']."&amp;nbsp&lt;/td&gt;".
                   '&lt;td&gt;'.$arr['year']."&amp;nbsp&lt;/td&gt;&lt;/tr&gt;";}
  
           $idnumber=$arr['idnumber'];
           ?&gt; 
  
          &lt;input type="hidden" value="&lt;?php $group ?&gt;" name="group"&gt;
          &lt;input type="submit" value="Enrol Student" name="submit"&gt;
          &lt;/form&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>and here is my enrol.php</p>
  
  <pre><code>    &lt;?php 
      if(isset($_REQUEST['submit'])){
  
      $ids = join (', ', $_POST['idnumber']);
      $sql="INSERT INTO login (section) values ('$_POST[group]') WHERE idnumber='$ids'";
      mysql_query($sql);
  
      $count=mysql_affected_rows();
  
      if($count==1){
                    echo '&lt;script type="text/javascript"&gt;alert("Added Sucessfully")&lt;/script&gt;';
  
      }else{
                  echo '&lt;script type="text/javascript"&gt;alert("Error!")&lt;/script&gt;';
  
                  }
       }
      ?&gt;
  </code></pre>
  
  <p>how can i solve this problem? i have been trying to search for a solution but i cant seem to find any. please help.</p>