No error, and No changes in the Database
<p>I need to set the classid's of the checked checkboxes to be PAID
and the non-checked to be UNPAID.
What can be the problem that is preventing database changing?
Im checking some checkboxes in the html page.
When i press Save the page resets and when i check the database(PhpMyAdmin) there are no changes.</p>

<p>Here's my code :</p>

<pre><code>while($row = mysql_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  ?&gt; &lt;input type="hidden" name="id1[]" value="&lt;?php echo $row['classid']; ?&gt;" /&gt;&lt;?php
 echo "&lt;td&gt;"  . $row['class_date'] .  "&lt;/td&gt;";
    echo "&lt;td&gt;"  . $row['class_time'] .  "&lt;/td&gt;";
   echo "&lt;td&gt;"  . $row['sal_teach'] .  "&lt;/td&gt;";
   echo "&lt;td align=center&gt;"  . $row['status_teach'] .  "&lt;/td&gt;"; ?&gt;
   &lt;!--echo "&lt;td&gt;&lt;a href='getpaid2.php?id={$row['classid']}'&gt;Get Paid&lt;/a&gt;&lt;/td&gt;";--&gt;
  &lt;td align="center"&gt;&lt;input name="ONOFF[&lt;?php echo $row['classid']; ?&gt;]" type="checkbox" /&gt;&lt;/td&gt;
&lt;?php
  echo "&lt;/tr&gt;";
  }
echo "&lt;tr&gt;&lt;td colspan=5&gt;&lt;input type='submit' name='submit1' value='Save'/&gt;&lt;/td&gt;&lt;/tr&gt;";
  echo "&lt;/table&gt;&lt;/div&gt;";

    if(isset($_POST['submit1'])){

  foreach($_POST['id1'] as $id1)
 { 
  $status1 = 'UNPAID';
    if (isset($_POST['ONOFF'][$id1]))
    {
        $status1 = 'PAID';
    }

  $sql1="UPDATE class SET status_teach='$status1' WHERE classid=$id1";  

$myconn=mysql_connect('localhost','root','') or die("Couldn't Connect to the Server");
mysql_select_db('bddschool', $myconn) or die ("message");
  mysql_query($sql1,$mycon);
 } 
} 
</code></pre>
