I have an issue with an insert statement not producing what I think it should produce...

Here are the relevant parts of the code:

$free_pos[0][0] = $free_pos[1][0] = $left_top = $row[0];// value is 10000002
    $free_pos[0][1] = $free_pos[1][1] = $left_step = $row[1];// value is 1
    $free_pos[2][0] = $free_pos[3][0] = $right_top = $row[0];// value is 10000003
    $free_pos[2][1] = $free_pos[3][1] = $right_step = $row[1];// value is 1

    $next_element = 0 ;
    $max_element = 3 ;
    while ( $next_element <= $max_element ) {
      $sql_i="INSERT INTO position_table VALUES ('', '$free_pos[$next_element][0]', '$free_pos[$next_element][1]', '', now(), now(), 'M')" ;

    }

The value of the first insert statement should be:

INSERT INTO position_table VALUES ('', '10000002', '1', '', now(), now(), 'M')

But what it is when it is run is this:

INSERT INTO position_table VALUES ('', 'Array[0]', 'Array[1]', '', now(), now(), 'M')

Any suggestions on what I'm doing wrong?

Your help would be greatly appreciated.

Douglas

Recommended Answers

All 10 Replies

It seems that $row[0] and $row[1] contain Arrays, NOT the numeric value you think they have. Try using:
assuming they are INDEXED arrays, try $row[0][0] and $row[1][0] instead.

The insert statement is using 2 dimensional array elements

$sql_i="INSERT INTO position_table VALUES ('', '$free_pos[$next_element][0]', '$free_pos[$next_element][1]', '', now(), now(), 'M')" ;

$free_pos[$next_element][0] is the same as $free_pos[0][0] for the first insert, and changes with the $next_element in the while loop.

And the values of $row[0] and $row[1] are actually the values as stated. ( I printed them out to be sure)

Just noticed on the original post, I forgot to indicate that there is a ++$next_element; at the end of the while loop to iterate through it, but that is in place, and has no bearing on this issue, at least not that I can tell.

The insert statement is using 2 dimensional array elements

$sql_i="INSERT INTO position_table VALUES ('', '$free_pos[$next_element][0]', '$free_pos[$next_element][1]', '', now(), now(), 'M')" ;

$free_pos[$next_element][0] is the same as $free_pos[0][0] for the first insert, and changes with the $next_element in the while loop.

And the values of $row[0] and $row[1] are actually the values as stated. ( I printed them out to be sure)

Just noticed on the original post, I forgot to indicate that there is a ++$next_element; at the end of the while loop to iterate through it, but that is in place, and has no bearing on this issue, at least not that I can tell.

OK, I figured it out and am posting it here for anyone else that is interested...

Apparently, since the 2 dimensional array element is being used within single quotes, it isn't being evaluated... so I tested this, and it works just fine...

$sql_i="INSERT INTO position_table VALUES ('', ".$free_pos[$next_element][0].", ".$free_pos[$next_element][1].", '', now(), now(), 'M')" ;

Isn't it amazing what little things can cause so many hours of trying to FIX IT...

Thanks again, and I hope this helps someone somewhere down the road.

Douglas:-O

please help me.. i has try to insert the value into mysql db more than 1 week, but i did not get the solution.. please check my sql query too.. :((

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\integombmds\cocurriculumEvaluation2.php on line 214

only the 'totalPoints' and 'gredCC' were inserted. why??. tq

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com 

</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style101 {color: #000000; font-weight: bold; }
.style108 {font-size: 12; }
.style109 {font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}
.style114 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
.style119 {font-size: 12px; color: #000000; font-family: Arial, Helvetica, sans-serif; }
.style62 {color: #000000}
.style71 {font-size: 12px}
.style72 {font-family: Arial, Helvetica, sans-serif}
.style77 {font-size: 15px;
    color: #FF0000;
    font-weight: bold;
}
.style85 {font-size: 10px;
    font-family: Arial, Helvetica, sans-serif;
}
.style86 {font-size: 10px;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
}
.style94 {color: #FFFFFF; font-weight: bold; }
.style95 {font-size: 11px;
    color: #666666;
    font-family: Geneva, Arial, Helvetica, sans-serif;
}
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #F1F1F1;
}
a:hover {
    text-decoration: none;
    color: #FFFFFF;
}
a:active {
    text-decoration: none;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="749" height="30" border="0" align="center">
  <tr>
    <td width="90" height="26" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="index.php"><img src="images/home.JPG" width="90" height="22" /></a></td>
    <td width="90" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="userManual.php"><img src="images/um.JPG" width="90" height="22" /></a></td>
    <td width="90" bordercolor="#0066CC" bgcolor="#FFFFFF"><div align="center" class="style94"><a href="contactUs.php"><img src="images/contact.JPG" width="90" height="22" /></a></div></td>
    <td width="461" bordercolor="#0000CC">&nbsp;</td>
  </tr>
</table>
<table width="742" height="595" border="0" align="center" bgcolor="#F1F1F1">
  <tr>
    <td width="733" height="162" bgcolor="#F1F1F1"><div align="center">
      <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','733','height','160','src','images/sbpi banner2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scale','exactfit','movie','images/sbpi banner2' ); //end AC code
        </script>
      <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="733" height="160">
          <param name="movie" value="images/sbpi banner2.swf" />
          <param name="quality" value="high" />
          <param name="SCALE" value="exactfit" />
          <embed src="images/sbpi banner2.swf" width="733" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
        </object>
        </noscript>
    </div></td>
  </tr>
  <tr>
    <td height="389" bgcolor="f1f1f1"><table width="731" border="1" align="center" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
      <tr>
        <td width="721" height="406"><form method="post" action="">
          <table width="723" border="0" align="center">
            <tr>
              <td colspan="4"><div align="center">
                <table width="682" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
                  <tr>
                    <td height="33" colspan="4" class="style62 style71 style72"><div align="center"><span class="style77"> <strong>
                      <?php

$idt = $_GET['idT'];

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
    $conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
    mysql_select_db($dbname,$conn);

$result = mysql_query("SELECT * from students where icNo='$idt'");
while($row = mysql_fetch_array($result))
{

?>
                    </strong> Merit for Co curriculum Evaluation</span></div></td>
                  </tr>
                  <tr>
                    <td height="33" colspan="4" class="style72 style71 style62">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="48" height="29" class="style62"><span class="style72 style71 style62"><strong>Name </strong></span></td>
                    <td width="294" class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['name'] ?></span></td>
                    <td height="29" class="style62"><span class="style72 style71"><strong>IC No</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['icNo'] ?><span class="style109">
                      <input type="hidden" value="<?php echo $row['icNo'] ?>" name="<?php echo $row['icNo'] ?>" />
                    </span></span></td>
                  </tr>
                  <tr>
                    <td height="32" class="style62 style71 style72"><strong>Gender</strong></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['gender'] ?></span></td>
                    <td><span class="style109"><strong>Class Teacher</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['classTeacher'] ?></span></td>
                  </tr>
                  <tr>
                    <td height="28"><span class="style109"><strong>Year</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['year'] ?></span></td>
                    <td width="88">&nbsp;</td>
                    <td width="252" class="style62">&nbsp;</td>
                  </tr>
                </table>
                <hr />
              </div></td>
            </tr>
            <tr>
              <td colspan="4"><div align="center" class="style72 style71">
                <table width="686" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
                  <tr>
                    <td colspan="4" bgcolor="#FFFFFF"><strong>Co curriculum Categories</strong></td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="20" bgcolor="#DBE0E3">&nbsp;</td>
                    <td width="29" bgcolor="#DBE0E3"><div align="left" class="style109">
                      <div align="left">Code</div>
                    </div></td>
                    <td width="111" bgcolor="#DBE0E3"><div align="left" class="style71">
                      <div align="left"><strong>Co curriculum Type</strong></div>
                    </div></td>
                    <td width="369" bgcolor="#DBE0E3"><div align="left" class="style71">
                      <div align="left"><strong>Co curriculum Name</strong></div>
                    </div></td>
                    <td width="37" bgcolor="#DBE0E3"><div align="left"><span class="style109">Merit</span></div></td>
                    <td width="94" bgcolor="#DBE0E3"><div align="left"><span class="style109">Date</span></div></td>
                  </tr>
                  <?php

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
    $conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
    mysql_select_db($dbname,$conn);

$result= mysql_query("SELECT * from cocurriculum ORDER BY cocurriculumType ASC");
while($row = mysql_fetch_array($result))

{
?>
                  <tr>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><input name="choice[]" type="checkbox" value="<?php echo $row['cocurriculumSubCode'] ?>" /></td>
                    <td height="24" bordercolor="#CCCCCC" bgcolor="#F1F1F1"><strong><?php echo $row['cocurriculumSubCode'] ?></strong></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['cocurriculumType'] ?></strong></span></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['cocurriculumSubType'] ?></strong></span></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="center" class="style109"> <?php echo $row['cocurriculumMeritPoint'] ?>
                                  <input type="hidden" value="<?php echo $row['cocurriculumMeritPoint'] ?>" name="meritCC_<?php echo $row['cocurriculumSubCode'] ?>" />
                    </div></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="left"><strong>
                      <input type="text" id="dateCC_<?php echo $row['cocurriculumSubCode']; ?>" size="7" maxlength="8" name="dateCC_<?php echo $row['cocurriculumSubCode']; ?>" />
                      <a href="javascript:NewCal('dateCC_<?php echo $row['cocurriculumSubCode']; ?>','ddmmyyyy')"><img src="images/iconCalendar.gif" width="16" height="16" border="0" /></a> &nbsp;</strong></div></td>
                  </tr>
                  <?php }?>
                </table>
                <hr />
              </div></td>
            </tr>
            <?php
if(!empty($_POST)):

echo '<pre>';
print_r($_POST);
echo '</pre>';

#die();
$totalCCPoints = 0;
$idt=$_POST['icNo'];
 $ccsc=$_POST['cocurriculumSubCode'];
 $cct=$_POST['cocurriculumType'];
 $ccst=$_POST['cocurriculumSubType'];
 $ccmp=$_POST['cocurriculumMeritPoint'];
  $ccc=$_POST['choice[]'];
  $dcc=$_POST['dateCC_'];
 $tccp=$_POST['totalCCPoints'];
 $gcc=$_POST['gredCC'];
 $tcp=$_POST['totalCPoints'];
 $tmp=$_POST['totalMPoints'];
  $tp=$_POST['totalPoints'];


//baca pilihan yang dipilih
    foreach($_POST['choice'] as $k => $v)
    {
    //$tp = $row['totalPoints'];
     $gcc=$_POST['gredCC'];
    $totalCCPoints += $_POST["meritCC_".$v];
    ///$_POST['choice'] ;

    if($totalCCPoints>=80 && $totalCCPoints<=100)
    $gredCC = 'A';

    else if($totalCCPoints>=70 && $totalCCPoints<80)
    $gredCC = 'B';

    else if($totalCCPoints>=60 && $totalCCPoints<70)
        $gredCC = 'C';

    else if($totalCCPoints>=50 && $totalCCPoints<60)
        $gredCC = 'D';

    else if($totalCCPoints>=40 && $totalCCPoints<50)
        $gredCC = 'E';

    else if($totalCCPoints>=0 && $totalCCPoints<40)
        $gredCC = 'F';


        //$tp += $tccp;

    }


 echo $idt; echo $ccsc; echo $tccp; echo $dcc; echo $acct; echo $gcc;

$result=mysql_query("SELECT * from students WHERE icNo='$idt'")or die (mysql_error());
$row=mysql_fetch_array($result);
$tp= $tcp+$tccp+$tmp;
//$NoKP=$_SESSION['MM_Username'];
//$JumlahHarga=$bilangan*40.00;
mysql_query("UPDATE students SET totalPoints='$tp' WHERE icNo='$idt'")or die (mysql_error());
mysql_query("INSERT INTO cocurriculumevaluation (icNo,cocurriculumSubCode,choice,dateCC_, totalCCPoints, gredCC) VALUES('$idt','$ccsc','$ccc','$ccsc','$tccp','$gcc')")or die (mysql_error());
/*if ($idt)




/*   echo $idt; echo $ccsc; echo $tccp; echo $dcc; echo $acct; echo $gcc;

 $insert = "INSERT INTO cocurriculumevaluation (icNo, cocurriculumSubCode, choice, dateCC_, totalCCPoints, gredCC) VALUES 
 ('".$_POST['icNo']."','".$_POST['cocurriculumSubCode']."','".$_POST['choice']."','".$_POST['dateCC_']."', '".$_POST['totalCCPoints']."', '".$_POST['gredCC']."')";
    $add_cocurriculumevaluation = mysql_query($insert);

//

endif;
?>



            <tr>
              <td width="182">&nbsp;</td>
              <td width="28" class="style114">&nbsp;</td>
              <td width="499" colspan="2"><div align="right" class="style114">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
            </tr>
            <tr>
              <td><span class="style109">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Co curriculum Points</span></td>
              <td class="style114"><div align="center" class="style114">
                <input name="totalCCPoints" readonly="" id="totalCCPoints" value="<?php echo $totalCCPoints; ?>" size="2" maxlength="3" />
              </div></td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td><span class="style109">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gred</span></td>
              <td class="style114"><div align="center">
                  <input name="gredCC" readonly="" id="gredCC" value="<?php echo $gredCC; ?>" size="2" maxlength="1" />
              </div></td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;&nbsp;&nbsp;&nbsp;<span class="style109">Total Points</span></td>
              <td class="style114"> <div align="center"></div></td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2"><div align="right"><span class="style71"><span class="style108 style72 style71 style71"><span class="style62 style71 style72"> <strong><a href="searchStudentCocurriculum.php" class="style62"><span class="style119">[CANCEL]</span></a></strong>
                                <input name="calculate" type="submit" class="style114" value="Calculate" />
                                <input name="reset" type="reset" class="style114" id="reset" value="Reset" />
                                <input type="submit" name="submit" id="submit"  value="Submit" />
              </span></span></span></div></td>
            </tr>
            <tr>
              <td height="34">&nbsp;</td>
              <td>&nbsp;</td>
              <td colspan="2"><div align="right"><span class="style108 style72 style71 style71"><span class="style114"> </span> </span></div>
                      <p>&nbsp;</p></td>
            </tr>
            <tr>
              <td height="34"><span class="style71"></span></td>
              <td><span class="style71"></span></td>
              <td colspan="2"><div align="right" class="style108 style72 style71 style71"></div>                </td>
            </tr>
          </table>
        </form></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="36"><div align="right">
      <hr />
      <div align="right"><span class="style86 style87"><img src="images/phone.JPG" width="19" height="14" /></span> <span class="style85 style87">03-61863050 <img src="images/fax.JPG" width="19" height="14" /> 03-61858472 <img src="images/email.JPG" width="19" height="14" />webmastermds@yahoo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="style95">All Rights Reserved © INTEGOMB MDS 2011</span></div>
    </div></td>
  </tr>
</table>
</body>
</html>
<?php
}?>

Warning: Invalid argument supplied for foreach()

Well, if no item is checked, then there $_POST would NOT be an array, and the argument to the foreach would be invalid - triggering the warning you are seeing. You need to make sure the user has posted all the required fields first.

On another note, $ccc=$_POST['choice[]']; (around line 203) doesn't make sense. To derefence an "array" of checkboxes, even though you code it as <input type="checkbox" name="choice[]" /> , in your PHP you do NOT use the brackets to derefence the posted/submitted item. So strictly speaking it should simply be: $ccc=$_POST['choice']; Having said that, even if you correct line 203 as indicated, the $ccc still doesn't make sense, because $ccc would have an Array() . What you need to do is to iterate over the choice array and foreach item in the array insert it into the db. This means that $ccc should really be the same value as $v in your foreach() . So, all those sql statements seem to depend on the checked items need to be within the foreach construct, and also, within the foreach , assign $v to $ccc .

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com 

</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style101 {color: #000000; font-weight: bold; }
.style108 {font-size: 12; }
.style109 {font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style114 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
.style119 {font-size: 12px; color: #000000; font-family: Arial, Helvetica, sans-serif; }
.style62 {color: #000000}
.style71 {font-size: 12px}
.style72 {font-family: Arial, Helvetica, sans-serif}
.style77 {font-size: 15px;
color: #FF0000;
font-weight: bold;
}
.style85 {font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
}
.style86 {font-size: 10px;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
.style94 {color: #FFFFFF; font-weight: bold; }
.style95 {font-size: 11px;
color: #666666;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #F1F1F1;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: none;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="749" height="30" border="0" align="center">
<tr>
<td width="90" height="26" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="index.php"><img src="images/home.JPG" width="90" height="22" /></a></td>
<td width="90" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="userManual.php"><img src="images/um.JPG" width="90" height="22" /></a></td>
<td width="90" bordercolor="#0066CC" bgcolor="#FFFFFF"><div align="center" class="style94"><a href="contactUs.php"><img src="images/contact.JPG" width="90" height="22" /></a></div></td>
<td width="461" bordercolor="#0000CC">&nbsp;</td>
</tr>
</table>
<table width="742" height="595" border="0" align="center" bgcolor="#F1F1F1">
<tr>
<td width="733" height="162" bgcolor="#F1F1F1"><div align="center">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','733','height','160','src','images/sbpi banner2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scale','exactfit','movie','images/sbpi banner2' ); //end AC code
</script>
<noscript>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="733" height="160">
<param name="movie" value="images/sbpi banner2.swf" />
<param name="quality" value="high" />
<param name="SCALE" value="exactfit" />
<embed src="images/sbpi banner2.swf" width="733" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
</object>
</noscript>
</div></td>
</tr>
<tr>
<td height="389" bgcolor="f1f1f1"><table width="731" border="1" align="center" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
<tr>
<td width="721" height="406"><form method="post" action="">
<table width="723" border="0" align="center">
<tr>
<td colspan="4"><div align="center">
<table width="682" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
<tr>
<td height="33" colspan="4" class="style62 style71 style72"><div align="center"><span class="style77"> <strong>
<?php

$idt = $_GET['idT'];

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
$conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
mysql_select_db($dbname,$conn);

$result = mysql_query("SELECT * from students where icNo='$idt'");
while($row = mysql_fetch_array($result))
{

?>
</strong> Merit for Co curriculum Evaluation</span></div></td>
</tr>
<tr>
<td height="33" colspan="4" class="style72 style71 style62">&nbsp;</td>
</tr>
<tr>
<td width="48" height="29" class="style62"><span class="style72 style71 style62"><strong>Name </strong></span></td>
<td width="294" class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['name'] ?></span></td>
<td height="29" class="style62"><span class="style72 style71"><strong>IC No</strong></span></td>
<td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['icNo'] ?><span class="style109">
<input type="hidden" value="<?php echo $row['icNo'] ?>" name="<?php echo $row['icNo'] ?>" />
</span></span></td>
</tr>
<tr>
<td height="32" class="style62 style71 style72"><strong>Gender</strong></td>
<td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['gender'] ?></span></td>
<td><span class="style109"><strong>Class Teacher</strong></span></td>
<td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['classTeacher'] ?></span></td>
</tr>
<tr>
<td height="28"><span class="style109"><strong>Year</strong></span></td>
<td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['year'] ?></span></td>
<td width="88">&nbsp;</td>
<td width="252" class="style62">&nbsp;</td>
</tr>
</table>
<hr />
</div></td>
</tr>
<tr>
<td colspan="4"><div align="center" class="style72 style71">
<table width="686" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<td colspan="4" bgcolor="#FFFFFF"><strong>Co curriculum Categories</strong></td>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
<td width="20" bgcolor="#DBE0E3">&nbsp;</td>
<td width="29" bgcolor="#DBE0E3"><div align="left" class="style109">
<div align="left">Code</div>
</div></td>
<td width="111" bgcolor="#DBE0E3"><div align="left" class="style71">
<div align="left"><strong>Co curriculum Type</strong></div>
</div></td>
<td width="369" bgcolor="#DBE0E3"><div align="left" class="style71">
<div align="left"><strong>Co curriculum Name</strong></div>
</div></td>
<td width="37" bgcolor="#DBE0E3"><div align="left"><span class="style109">Merit</span></div></td>
<td width="94" bgcolor="#DBE0E3"><div align="left"><span class="style109">Date</span></div></td>
</tr>
<?php

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
$conn = mysql_connect("$hostname", "$noID", "$kataLaluan") or die ('Line '.__LINE__.': '.mysql_error());
mysql_select_db($dbname,$conn) or die ('Line '.__LINE__.': '.mysql_error());

$result= mysql_query("SELECT * from cocurriculum ORDER BY cocurriculumType ASC") or die ('Line '.__LINE__.': '.mysql_error());
while($row = mysql_fetch_array($result))
{
?>
    <tr>
    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><input name="choice[]" type="checkbox" value="<?php echo $row['cocurriculumSubCode'] ?>" /></td>
    <td height="24" bordercolor="#CCCCCC" bgcolor="#F1F1F1"><strong><?php echo $row['cocurriculumSubCode'] ?></strong></td>
    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['cocurriculumType'] ?></strong></span></td>
    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['cocurriculumSubType'] ?></strong></span></td>
    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="center" class="style109"> <?php echo $row['cocurriculumMeritPoint'] ?>
    <input type="hidden" value="<?php echo $row['cocurriculumMeritPoint'] ?>" name="meritCC_<?php echo $row['cocurriculumSubCode'] ?>" />
    </div></td>
    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="left"><strong>
    <input type="text" id="dateCC_<?php echo $row['cocurriculumSubCode']; ?>" size="7" maxlength="8" name="dateCC_<?php echo $row['cocurriculumSubCode']; ?>" />
    <a href="javascript:NewCal('dateCC_<?php echo $row['cocurriculumSubCode']; ?>','ddmmyyyy')"><img src="images/iconCalendar.gif" width="16" height="16" border="0" /></a> &nbsp;</strong></div></td>
    </tr>
<?php }?>
</table>
<hr />
</div></td>
</tr>
<?php
if(!empty($_POST))
{
	echo '<pre>';
	print_r($_POST);
	echo '</pre>';

	//initially, assume all the required data was submitted
	$OK=true;

	
	//make a 'list' of all your required fields. The keys in the array correspond
	//to the names in the required form fields. The values would be the ErrorMessage 
	//to display.  When the ErrorMessage starts with '::', only the ErrorMessage 
	//specified will be displayed (minus the leading '::') if it does NOT start 
	//with '::', then the ErrorMessage will have suffix ' is a required field' 
	//appended to it.
	$requiredFields=array(	'icNo'=>'IC Number'
							,'cocurriculumSubCode'=>'Sub Code'
							,'cocurriculumType'=>'Type'
							,'cocurriculumSubType'=>'Sub Type'
							,'cocurriculumMeritPoint'=>'Merit Point'
							,'choice'=>'::You must check at least one item'
							,'dateCC_'=>'Date CC'
							,'totalCCPoints'=>'Points'
							,'gredCC'=>'Gred CC'
							,'totalCPoints'=>'C Points'
							,'totalMPoints'=>'M Points'
							,'totalPoints'=>'Total Points'
							);
	
	//conver the list to an array
	$requiredFields=explode(',',$requiredFields);
	
	//now see if any of them is missing
	foreach($requiredFields as $fld=>$errorMessage)
	{
		if( !isset($_POST[$fld]) || (empty($_POST[$fld]) && $_POST[$fld]!=0) )
		{
			//inform of missing field
			echo (substr($errorMessage,0,2)=='::' ? substr($errorMessage,2) : $errorMessage.' is a required field.');

			//update variable so you know that something is missing
			$OK=false;
		}
		else
		{
			$_POST[$fld]=mysql_real_escape_string($_POST[$fld]);
		}
	}

	//process only if everything is still OK
	if( $OK )
	{
		#die();
		$totalCCPoints = 0;
		$idt=$_POST['icNo'];
		$ccsc=$_POST['cocurriculumSubCode'];
		$cct=$_POST['cocurriculumType'];
		$ccst=$_POST['cocurriculumSubType'];
		$ccmp=$_POST['cocurriculumMeritPoint'];
		//$ccc=$_POST['choice[]'];
		$dcc=$_POST['dateCC_'];
		$tccp=$_POST['totalCCPoints'];
		$gcc=$_POST['gredCC'];
		$tcp=$_POST['totalCPoints'];
		$tmp=$_POST['totalMPoints'];
		$tp=$_POST['totalPoints'];


		//baca pilihan yang dipilih
		foreach($_POST['choice'] as $k => $v)
		{
			$ccc=$v;
			//$tp = $row['totalPoints'];
			$gcc=$_POST['gredCC'];
			$totalCCPoints += $_POST["meritCC_".$v];
			///$_POST['choice'] ;

			if($totalCCPoints>=80 && $totalCCPoints<=100)
				$gredCC = 'A';
			elseif($totalCCPoints>=70 && $totalCCPoints<80)
				$gredCC = 'B';
			elseif($totalCCPoints>=60 && $totalCCPoints<70)
				$gredCC = 'C';
			elseif($totalCCPoints>=50 && $totalCCPoints<60)
				$gredCC = 'D';
			else if($totalCCPoints>=40 && $totalCCPoints<50)
				$gredCC = 'E';
			elseif($totalCCPoints>=0 && $totalCCPoints<40)
				$gredCC = 'F';
			//$tp += $tccp;

    		echo $idt;
	    	echo $ccsc;
    		echo $tccp;
    		echo $dcc;
	    	echo $acct;
    		echo $gcc;
    		$result=mysql_query("SELECT * from students WHERE icNo='$idt'") or die ('Line '.__LINE__.': '.mysql_error());
	    	$row=mysql_fetch_array($result);
    		$tp= $tcp+$tccp+$tmp;
    		//$NoKP=$_SESSION['MM_Username'];
    		//$JumlahHarga=$bilangan*40.00;
    		mysql_query("UPDATE students SET totalPoints='$tp' WHERE icNo='$idt'")or die ('Line '.__LINE__.': '.mysql_error());
    		mysql_query("INSERT INTO cocurriculumevaluation (icNo,cocurriculumSubCode,choice,dateCC_, totalCCPoints, gredCC) VALUES('$idt','$ccsc','$ccc','$ccsc','$tccp','$gcc')") or die ('Line '.__LINE__.': '.mysql_error());
    
    		//if ($idt)
    		//	 echo $idt; echo $ccsc; echo $tccp; echo $dcc; echo $acct; echo $gcc;
			/*    
    		$insert = "INSERT INTO cocurriculumevaluation (icNo, cocurriculumSubCode, choice, dateCC_, totalCCPoints, gredCC) VALUES 
    				('".$_POST['icNo']."','".$_POST['cocurriculumSubCode']."','".$_POST['choice']."','".$_POST['dateCC_']."', '".$_POST['totalCCPoints']."', '".$_POST['gredCC']."')";
			*/
    		$add_cocurriculumevaluation = mysql_query($insert) or die('Line '.__LINE__.': '.mysql_error());
		}
	}
}
?>



<tr>
<td width="182">&nbsp;</td>
<td width="28" class="style114">&nbsp;</td>
<td width="499" colspan="2"><div align="right" class="style114">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
</tr>
<tr>
<td><span class="style109">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Co curriculum Points</span></td>
<td class="style114"><div align="center" class="style114">
<input name="totalCCPoints" readonly="" id="totalCCPoints" value="<?php echo $totalCCPoints; ?>" size="2" maxlength="3" />
</div></td>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td><span class="style109">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gred</span></td>
<td class="style114"><div align="center">
<input name="gredCC" readonly="" id="gredCC" value="<?php echo $gredCC; ?>" size="2" maxlength="1" />
</div></td>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;<span class="style109">Total Points</span></td>
<td class="style114"> <div align="center"></div></td>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="style114">&nbsp;</td>
<td colspan="2"><div align="right"><span class="style71"><span class="style108 style72 style71 style71"><span class="style62 style71 style72"> <strong><a href="searchStudentCocurriculum.php" class="style62"><span class="style119">[CANCEL]</span></a></strong>
<input name="calculate" type="submit" class="style114" value="Calculate" />
<input name="reset" type="reset" class="style114" id="reset" value="Reset" />
<input type="submit" name="submit" id="submit" value="Submit" />
</span></span></span></div></td>
</tr>
<tr>
<td height="34">&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2"><div align="right"><span class="style108 style72 style71 style71"><span class="style114"> </span> </span></div>
<p>&nbsp;</p></td>
</tr>
<tr>
<td height="34"><span class="style71"></span></td>
<td><span class="style71"></span></td>
<td colspan="2"><div align="right" class="style108 style72 style71 style71"></div> </td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td height="36"><div align="right">
<hr />
<div align="right"><span class="style86 style87"><img src="images/phone.JPG" width="19" height="14" /></span> <span class="style85 style87">03-61863050 <img src="images/fax.JPG" width="19" height="14" /> 03-61858472 <img src="images/email.JPG" width="19" height="14" />webmastermds@yahoo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="style95">All Rights Reserved © INTEGOMB MDS 2011</span></div>
</div></td>
</tr>
</table>
</body>
</html>
<?php
}?>

why i ur code cant be implemented.. help me please... :(. im tired to solve all these

my system need to add new value to curriculum table. then, the values will be display at another forms for curriculum evaluation. the values are display in a checkbox. then, i will count the points they get and insert the data into curriculum evaluation. but, until now, i cant solve these.. nobody wants to help me.. including my truth friends..
:(

On my previous post, COMMENT OUT line 302:

...
/*    		$add_cocurriculumevaluation = mysql_query($insert) or die('Line '.__LINE__.': '.mysql_error());
*/
...

If you are still having problems, post a link to your page So I can see the markup that your script is generating.

Regards,
Hielo

hi..

i need to check the box and insert the input for date.. the problem is at the foreach loop.. when i submit the form, the date that i input is not in a database.. why?? already trying hundred times..... please help me refine the loop.. maybe i should put the date too between $_POST ['choice']....
i did not know it

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of [url]http://www.rainforestnet.com[/url]
//Script featured on JavaScript Kit ([url]http://www.javascriptkit.com[/url])
//For this script, visit [url]http://www.javascriptkit.com[/url] 

</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style101 {color: #000000; font-weight: bold; }
.style108 {font-size: 12; }
.style109 {font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}
.style114 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
.style119 {font-size: 12px; color: #000000; font-family: Arial, Helvetica, sans-serif; }
.style62 {color: #000000}
.style71 {font-size: 12px}
.style72 {font-family: Arial, Helvetica, sans-serif}
.style77 {font-size: 15px;
    color: #FF0000;
    font-weight: bold;
}
.style85 {font-size: 10px;
    font-family: Arial, Helvetica, sans-serif;
}
.style86 {font-size: 10px;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
}
.style94 {color: #FFFFFF; font-weight: bold; }
.style95 {font-size: 11px;
    color: #666666;
    font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="749" height="30" border="0" align="center">
  <tr>
    <td width="90" height="26" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="index.php"><img src="images/home.JPG" width="90" height="22" /></a></td>
    <td width="90" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="userManual.php"><img src="images/um.JPG" width="90" height="22" /></a></td>
    <td width="90" bordercolor="#0066CC" bgcolor="#FFFFFF"><div align="center" class="style94"><a href="contactUs.php"><img src="images/contact.JPG" width="90" height="22" /></a></div></td>
    <td width="461" bordercolor="#0000CC">&nbsp;</td>
  </tr>
</table>
<table width="742" height="595" border="0" align="center" bgcolor="#F1F1F1">
  <tr>
    <td width="733" height="162" bgcolor="#F1F1F1"><div align="center">
      <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','733','height','160','src','images/sbpi banner2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scale','exactfit','movie','images/sbpi banner2' ); //end AC code
        </script>
      <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="733" height="160">
          <param name="movie" value="images/sbpi banner2.swf" />
          <param name="quality" value="high" />
          <param name="SCALE" value="exactfit" />
          <embed src="images/sbpi banner2.swf" width="733" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
        </object>
        </noscript>
    </div></td>
  </tr>
  <tr>
    <td height="389" bgcolor="f1f1f1"><table width="731" border="1" align="center" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
      <tr>
        <td width="721" height="406"><form method="post" action="">
          <table width="723" border="0" align="center">
            <tr>
              <td colspan="4"><div align="center">
                <table width="682" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
                  <tr>
                    <td height="33" colspan="4" class="style62 style71 style72"><div align="center"><span class="style77"> <strong>
                      <?php

$idt = $_GET['idT'];

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
    $conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
    mysql_select_db($dbname,$conn);

$result = mysql_query("SELECT * from students where icNo='$idt'");
while($row = mysql_fetch_array($result))
{

?>
                    </strong> Merit for Co curriculum Evaluation</span></div></td>
                  </tr>
                  <tr>
                    <td height="33" colspan="4" class="style72 style71 style62">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="48" height="29" class="style62"><span class="style72 style71 style62"><strong>Name </strong></span></td>
                    <td width="294" class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['name'] ?></span></td>
                    <td height="29" class="style62"><span class="style72 style71"><strong>IC No</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['icNo'] ?><span class="style109">
                      <input type="hidden" value="<?php echo $row['icNo'] ?>" name="<?php echo $row['icNo'] ?>" />
                    </span></span></td>
                  </tr>
                  <tr>
                    <td height="32" class="style62 style71 style72"><strong>Gender</strong></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['gender'] ?></span></td>
                    <td><span class="style109"><strong>Class Teacher</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['classTeacher'] ?></span></td>
                  </tr>
                  <tr>
                    <td height="28"><span class="style109"><strong>Year</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['year'] ?></span></td>
                    <td width="88">&nbsp;</td>
                    <td width="252" class="style62">&nbsp;</td>
                  </tr>
                </table>
                <hr />
              </div></td>
            </tr>
            <tr>
              <td colspan="4"><div align="center" class="style72 style71">
                <table width="686" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
                  <tr>
                    <td colspan="4" bgcolor="#FFFFFF"><strong>Co curriculum Categories</strong></td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="20" bgcolor="#DBE0E3">&nbsp;</td>
                    <td width="29" bgcolor="#DBE0E3"><div align="left" class="style109">
                      <div align="left">Code</div>
                    </div></td>
                    <td width="125" bgcolor="#DBE0E3"><div align="left" class="style71">
                      <div align="left"><strong>Co curriculum Type</strong></div>
                    </div></td>
                    <td width="355" bgcolor="#DBE0E3"><div align="left" class="style71">
                      <div align="left"><strong>Co curriculum Name</strong></div>
                    </div></td>
                    <td width="37" bgcolor="#DBE0E3"><div align="left"><span class="style109">Merit</span></div></td>
                    <td width="94" bgcolor="#DBE0E3"><div align="left"><span class="style109">Date</span></div></td>
                  </tr>
                  <?php

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
    $conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
    mysql_select_db($dbname,$conn);

$result= mysql_query("SELECT * from cocurriculum ORDER BY cocurriculumType ASC");
while($row = mysql_fetch_array($result))

{
?>

                  <tr>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><input name="choice[]" type="checkbox" value="<?php echo $row['cocurriculumSubCode'] ?>" /></td>
                    <td height="24" bordercolor="#CCCCCC" bgcolor="#F1F1F1"><strong><?php echo $row['cocurriculumSubCode'] ?></strong></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['cocurriculumType'] ?></strong></span></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><strong><?php echo $row['cocurriculumSubType'] ?></strong></strong></span></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="center" class="style109"> <?php echo $row['cocurriculumMeritPoint'] ?>
                                  <input type="hidden" value="<?php echo $row['cocurriculumMeritPoint'] ?>" name="meritCC_<?php echo $row['cocurriculumSubCode'] ?>" />
                    </div></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="left"><strong>
                      <input typw="text" id="dateCC_" size="7" maxlength="10" name="dateCC_"  value="<?php echo $dateCC_; ?>" />
                    </strong></div></td>
                  </tr>
                  <?php }?>
                </table>
                <hr />
              </div></td>
            </tr>
            <?php
if(!empty($_POST)):

echo '<pre>';
print_r($_POST);
echo '</pre>';

#die();
//$totalCCPoints =0; 


//$idcc=$_POST['cocurriculumSubCode'];
//$cct=$_POST['cocurriculumType'];
//$ccst=$_POST['cocurriculumSubType'];
//$ccmp=$_POST['cocurriculumMeritPoint'];
    //  $idt=$_POST['icNo'];
$ccc=$_POST['choice[]'];
$dcc=$_POST['dateCC_'];
$tccp=$_POST['totalCCPoints'];
//$gcc=$_POST['gredCC'];
//$tcp=$_POST['totalCPoints'];
//$tmp=$_POST['totalMPoints'];
$tp=$_POST['totalPoints'];



//baca pilihan yang dipilih
    foreach($_POST['choice'] && $_POST['dateCC_'] as $k => $v)
    {
    echo $idt; echo $ccc; echo $dcc; echo $tccp;  echo $tp;
    //echo $gcc;

mysql_query("INSERT INTO cocurriculumevaluation (icNo, choice,  dateCC_) 
VALUES('$idt','$ccc[$k][$v]','$dcc')")or die (mysql_error());

$result=mysql_query("SELECT * from students WHERE icNo='$idt'")or die (mysql_error());
$row=mysql_fetch_array($result);

//$NoKP=$_SESSION['MM_Username'];
//$JumlahHarga=$bilangan*40.00;


//,'$dcc','$tccp','$gcc'
//mysql_query("UPDATE cocurriculumevaluation SET choice='$ccc[$k][$v]', cocurriculumSubCode='$ccsc',  totalCCPoints='$tccp', gredCC='$gcc' WHERE icNo='$idt' ")or die (mysql_error());

//mysql_query("UPDATE students SET totalPoints='$tp' WHERE icNo='$idt' ")or die (mysql_error());
    //$tp = $row['totalPoints'];
     //$gcc=$_POST['gredCC'];
    $totalCCPoints += $_POST["meritCC_".$v];




    ///$_POST['choice'] ;

    /*if($totalCCPoints>=80 && $totalCCPoints<=100)
    $gredCC = 'A';

    else if($totalCCPoints>=70 && $totalCCPoints<80)
    $gredCC = 'B';

    else if($totalCCPoints>=60 && $totalCCPoints<70)
        $gredCC = 'C';

    else if($totalCCPoints>=50 && $totalCCPoints<60)
        $gredCC = 'D';

    else if($totalCCPoints>=40 && $totalCCPoints<50)
        $gredCC = 'E';

    else if($totalCCPoints>=0 && $totalCCPoints<40)
        $gredCC = 'F';*/



        //$tp += $tccp;
        //  $totalCCPoints=$_POST['totalCCPoints']+ $_POST["meritCC_".$v];
        //$totalPoints=$_POST['$totalCCPoints']+$_POST['$totalCPoints']+$_POST['$totalMPoints'];


    }
        $tp= $tcp+$tccp+($tmp);

    $totalPoints=$totalCPoints+$totalCCPoints+$totalMPoints;



 mysql_query("UPDATE students SET totalPoints='$tp', totalCCPoints='$tccp'  WHERE icNo='$idt' ")or die (mysql_error());
//VALUES('','cocurriculumSubType',%s,%s,%s,%s)")or die (mysql_error());



/*{
$result=mysql_query("SELECT * from produk WHERE NoProduk='AP201'")or die (mysql_error());
$row=mysql_fetch_array($result);
$bilanganbaru = $row['Stok']-$bilangan;
$NoKP=$_SESSION['MM_Username'];
$JumlahHarga=$bilangan*40.00;
mysql_query("UPDATE produk SET Stok='$bilanganbaru' WHERE NoProduk='AP201'")or die (mysql_error());
mysql_query("INSERT INTO jualan (NoKP,NoProduk,Bilangan,JumlahHarga) VALUES('$NoKP','AP201','$bilangan','$JumlahHarga')")or die (mysql_error());
}*/

/*   echo $idt; echo $ccsc; echo $tccp; echo $dcc; echo $acct; echo $gcc;

 $insert = "INSERT INTO cocurriculumevaluation (icNo, cocurriculumSubCode, choice, dateCC_, totalCCPoints, gredCC) VALUES 
 ('".$_POST['icNo']."','".$_POST['cocurriculumSubCode']."','".$_POST['choice']."','".$_POST['dateCC_']."', '".$_POST['totalCCPoints']."', '".$_POST['gredCC']."')";
    $add_cocurriculumevaluation = mysql_query($insert);

//hsn*/

endif;
?>
            <tr>
              <td width="182">&nbsp;</td>
              <td width="28" class="style114">&nbsp;</td>
              <td width="499" colspan="2"><div align="right" class="style114">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
            </tr>
            <tr>
              <td><span class="style109">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Points</span></td>
              <td class="style114"><div align="center" class="style114">
                <input name="totalCCPoints" readonly="" id="totalCCPoints" value="<?php echo $totalCCPoints; ?>" size="2" maxlength="4" />
              </div></td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2"><div align="right"><span class="style71"><span class="style108 style72 style71 style71"><span class="style62 style71 style72"> <strong><a href="searchStudentCocurriculum.php" class="style62"><span class="style119">[CANCEL]</span></a></strong>
                                <input name="calculate" type="submit" class="style114" value="Calculate" />
                                <input name="reset" type="reset" class="style114" id="reset" value="Reset" />
                                <input type="submit" name="submit" id="submit"  value="Submit" />
              </span></span></span></div></td>
            </tr>
            <tr>
              <td height="34">&nbsp;</td>
              <td>&nbsp;</td>
              <td colspan="2"><div align="right"><span class="style108 style72 style71 style71"><span class="style114"> </span> </span></div>
                      <p>&nbsp;</p></td>
            </tr>
            <tr>
              <td height="34"><span class="style71"></span></td>
              <td><span class="style71"></span></td>
              <td colspan="2"><div align="right" class="style108 style72 style71 style71"></div></td>
            </tr>
          </table>
        </form></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="36"><div align="right">
      <hr />
      <div align="right"><span class="style86 style87"><img src="images/phone.JPG" width="19" height="14" /></span> <span class="style85 style87">03-61863050 <img src="images/fax.JPG" width="19" height="14" /> 03-61858472 <img src="images/email.JPG" width="19" height="14" />webmastermds@yahoo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="style95">All Rights Reserved © INTEGOMB MDS 2011</span></div>
    </div></td>
  </tr>
</table>
</body>
</html>
<?php
}?>

hi..

i need to check the box and insert the input for date.. the problem is at the foreach loop.. when i submit the form, the date that i input is not in a database.. why?? already trying hundred times..... please help me refine the loop.. maybe i should put the date too between $_POST ['choice']....
i did not know it

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript" src="datetimepicker.js">

//Date Time Picker script- by TengYong Ng of [url]http://www.rainforestnet.com[/url]
//Script featured on JavaScript Kit ([url]http://www.javascriptkit.com[/url])
//For this script, visit [url]http://www.javascriptkit.com[/url] 

</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style101 {color: #000000; font-weight: bold; }
.style108 {font-size: 12; }
.style109 {font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}
.style114 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
.style119 {font-size: 12px; color: #000000; font-family: Arial, Helvetica, sans-serif; }
.style62 {color: #000000}
.style71 {font-size: 12px}
.style72 {font-family: Arial, Helvetica, sans-serif}
.style77 {font-size: 15px;
    color: #FF0000;
    font-weight: bold;
}
.style85 {font-size: 10px;
    font-family: Arial, Helvetica, sans-serif;
}
.style86 {font-size: 10px;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
}
.style94 {color: #FFFFFF; font-weight: bold; }
.style95 {font-size: 11px;
    color: #666666;
    font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="749" height="30" border="0" align="center">
  <tr>
    <td width="90" height="26" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="index.php"><img src="images/home.JPG" width="90" height="22" /></a></td>
    <td width="90" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="userManual.php"><img src="images/um.JPG" width="90" height="22" /></a></td>
    <td width="90" bordercolor="#0066CC" bgcolor="#FFFFFF"><div align="center" class="style94"><a href="contactUs.php"><img src="images/contact.JPG" width="90" height="22" /></a></div></td>
    <td width="461" bordercolor="#0000CC">&nbsp;</td>
  </tr>
</table>
<table width="742" height="595" border="0" align="center" bgcolor="#F1F1F1">
  <tr>
    <td width="733" height="162" bgcolor="#F1F1F1"><div align="center">
      <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','733','height','160','src','images/sbpi banner2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scale','exactfit','movie','images/sbpi banner2' ); //end AC code
        </script>
      <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="733" height="160">
          <param name="movie" value="images/sbpi banner2.swf" />
          <param name="quality" value="high" />
          <param name="SCALE" value="exactfit" />
          <embed src="images/sbpi banner2.swf" width="733" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
        </object>
        </noscript>
    </div></td>
  </tr>
  <tr>
    <td height="389" bgcolor="f1f1f1"><table width="731" border="1" align="center" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
      <tr>
        <td width="721" height="406"><form method="post" action="">
          <table width="723" border="0" align="center">
            <tr>
              <td colspan="4"><div align="center">
                <table width="682" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#F1F1F1" bgcolor="#FFFFFF">
                  <tr>
                    <td height="33" colspan="4" class="style62 style71 style72"><div align="center"><span class="style77"> <strong>
                      <?php

$idt = $_GET['idT'];

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
    $conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
    mysql_select_db($dbname,$conn);

$result = mysql_query("SELECT * from students where icNo='$idt'");
while($row = mysql_fetch_array($result))
{

?>
                    </strong> Merit for Co curriculum Evaluation</span></div></td>
                  </tr>
                  <tr>
                    <td height="33" colspan="4" class="style72 style71 style62">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="48" height="29" class="style62"><span class="style72 style71 style62"><strong>Name </strong></span></td>
                    <td width="294" class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['name'] ?></span></td>
                    <td height="29" class="style62"><span class="style72 style71"><strong>IC No</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['icNo'] ?><span class="style109">
                      <input type="hidden" value="<?php echo $row['icNo'] ?>" name="<?php echo $row['icNo'] ?>" />
                    </span></span></td>
                  </tr>
                  <tr>
                    <td height="32" class="style62 style71 style72"><strong>Gender</strong></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['gender'] ?></span></td>
                    <td><span class="style109"><strong>Class Teacher</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['classTeacher'] ?></span></td>
                  </tr>
                  <tr>
                    <td height="28"><span class="style109"><strong>Year</strong></span></td>
                    <td class="style62"><span class="style105 style71 style72 style71 style72 style72 style72 style71"><?php echo $row['year'] ?></span></td>
                    <td width="88">&nbsp;</td>
                    <td width="252" class="style62">&nbsp;</td>
                  </tr>
                </table>
                <hr />
              </div></td>
            </tr>
            <tr>
              <td colspan="4"><div align="center" class="style72 style71">
                <table width="686" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
                  <tr>
                    <td colspan="4" bgcolor="#FFFFFF"><strong>Co curriculum Categories</strong></td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="20" bgcolor="#DBE0E3">&nbsp;</td>
                    <td width="29" bgcolor="#DBE0E3"><div align="left" class="style109">
                      <div align="left">Code</div>
                    </div></td>
                    <td width="125" bgcolor="#DBE0E3"><div align="left" class="style71">
                      <div align="left"><strong>Co curriculum Type</strong></div>
                    </div></td>
                    <td width="355" bgcolor="#DBE0E3"><div align="left" class="style71">
                      <div align="left"><strong>Co curriculum Name</strong></div>
                    </div></td>
                    <td width="37" bgcolor="#DBE0E3"><div align="left"><span class="style109">Merit</span></div></td>
                    <td width="94" bgcolor="#DBE0E3"><div align="left"><span class="style109">Date</span></div></td>
                  </tr>
                  <?php

include("C:/AppServ/www/integombmds/inc/dbconn.inc");
    $conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
    mysql_select_db($dbname,$conn);

$result= mysql_query("SELECT * from cocurriculum ORDER BY cocurriculumType ASC");
while($row = mysql_fetch_array($result))

{
?>

                  <tr>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><input name="choice[]" type="checkbox" value="<?php echo $row['cocurriculumSubCode'] ?>" /></td>
                    <td height="24" bordercolor="#CCCCCC" bgcolor="#F1F1F1"><strong><?php echo $row['cocurriculumSubCode'] ?></strong></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['cocurriculumType'] ?></strong></span></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><strong><?php echo $row['cocurriculumSubType'] ?></strong></strong></span></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="center" class="style109"> <?php echo $row['cocurriculumMeritPoint'] ?>
                                  <input type="hidden" value="<?php echo $row['cocurriculumMeritPoint'] ?>" name="meritCC_<?php echo $row['cocurriculumSubCode'] ?>" />
                    </div></td>
                    <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="left"><strong>
                      <input typw="text" id="dateCC_" size="7" maxlength="10" name="dateCC_"  value="<?php echo $dateCC_; ?>" />
                    </strong></div></td>
                  </tr>
                  <?php }?>
                </table>
                <hr />
              </div></td>
            </tr>
            <?php
if(!empty($_POST)):

echo '<pre>';
print_r($_POST);
echo '</pre>';

#die();
//$totalCCPoints =0; 


//$idcc=$_POST['cocurriculumSubCode'];
//$cct=$_POST['cocurriculumType'];
//$ccst=$_POST['cocurriculumSubType'];
//$ccmp=$_POST['cocurriculumMeritPoint'];
    //  $idt=$_POST['icNo'];
$ccc=$_POST['choice[]'];
$dcc=$_POST['dateCC_'];
$tccp=$_POST['totalCCPoints'];
//$gcc=$_POST['gredCC'];
//$tcp=$_POST['totalCPoints'];
//$tmp=$_POST['totalMPoints'];
$tp=$_POST['totalPoints'];



//baca pilihan yang dipilih
    foreach($_POST['choice'] && $_POST['dateCC_'] as $k => $v)
    {
    echo $idt; echo $ccc; echo $dcc; echo $tccp;  echo $tp;
    //echo $gcc;

mysql_query("INSERT INTO cocurriculumevaluation (icNo, choice,  dateCC_) 
VALUES('$idt','$ccc[$k][$v]','$dcc')")or die (mysql_error());

$result=mysql_query("SELECT * from students WHERE icNo='$idt'")or die (mysql_error());
$row=mysql_fetch_array($result);

//$NoKP=$_SESSION['MM_Username'];
//$JumlahHarga=$bilangan*40.00;


//,'$dcc','$tccp','$gcc'
//mysql_query("UPDATE cocurriculumevaluation SET choice='$ccc[$k][$v]', cocurriculumSubCode='$ccsc',  totalCCPoints='$tccp', gredCC='$gcc' WHERE icNo='$idt' ")or die (mysql_error());

//mysql_query("UPDATE students SET totalPoints='$tp' WHERE icNo='$idt' ")or die (mysql_error());
    //$tp = $row['totalPoints'];
     //$gcc=$_POST['gredCC'];
    $totalCCPoints += $_POST["meritCC_".$v];




    ///$_POST['choice'] ;

    /*if($totalCCPoints>=80 && $totalCCPoints<=100)
    $gredCC = 'A';

    else if($totalCCPoints>=70 && $totalCCPoints<80)
    $gredCC = 'B';

    else if($totalCCPoints>=60 && $totalCCPoints<70)
        $gredCC = 'C';

    else if($totalCCPoints>=50 && $totalCCPoints<60)
        $gredCC = 'D';

    else if($totalCCPoints>=40 && $totalCCPoints<50)
        $gredCC = 'E';

    else if($totalCCPoints>=0 && $totalCCPoints<40)
        $gredCC = 'F';*/



        //$tp += $tccp;
        //  $totalCCPoints=$_POST['totalCCPoints']+ $_POST["meritCC_".$v];
        //$totalPoints=$_POST['$totalCCPoints']+$_POST['$totalCPoints']+$_POST['$totalMPoints'];


    }
        $tp= $tcp+$tccp+($tmp);

    $totalPoints=$totalCPoints+$totalCCPoints+$totalMPoints;



 mysql_query("UPDATE students SET totalPoints='$tp', totalCCPoints='$tccp'  WHERE icNo='$idt' ")or die (mysql_error());
//VALUES('','cocurriculumSubType',%s,%s,%s,%s)")or die (mysql_error());



/*{
$result=mysql_query("SELECT * from produk WHERE NoProduk='AP201'")or die (mysql_error());
$row=mysql_fetch_array($result);
$bilanganbaru = $row['Stok']-$bilangan;
$NoKP=$_SESSION['MM_Username'];
$JumlahHarga=$bilangan*40.00;
mysql_query("UPDATE produk SET Stok='$bilanganbaru' WHERE NoProduk='AP201'")or die (mysql_error());
mysql_query("INSERT INTO jualan (NoKP,NoProduk,Bilangan,JumlahHarga) VALUES('$NoKP','AP201','$bilangan','$JumlahHarga')")or die (mysql_error());
}*/

/*   echo $idt; echo $ccsc; echo $tccp; echo $dcc; echo $acct; echo $gcc;

 $insert = "INSERT INTO cocurriculumevaluation (icNo, cocurriculumSubCode, choice, dateCC_, totalCCPoints, gredCC) VALUES 
 ('".$_POST['icNo']."','".$_POST['cocurriculumSubCode']."','".$_POST['choice']."','".$_POST['dateCC_']."', '".$_POST['totalCCPoints']."', '".$_POST['gredCC']."')";
    $add_cocurriculumevaluation = mysql_query($insert);

//hsn*/

endif;
?>
            <tr>
              <td width="182">&nbsp;</td>
              <td width="28" class="style114">&nbsp;</td>
              <td width="499" colspan="2"><div align="right" class="style114">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
            </tr>
            <tr>
              <td><span class="style109">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Points</span></td>
              <td class="style114"><div align="center" class="style114">
                <input name="totalCCPoints" readonly="" id="totalCCPoints" value="<?php echo $totalCCPoints; ?>" size="2" maxlength="4" />
              </div></td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="style114">&nbsp;</td>
              <td colspan="2"><div align="right"><span class="style71"><span class="style108 style72 style71 style71"><span class="style62 style71 style72"> <strong><a href="searchStudentCocurriculum.php" class="style62"><span class="style119">[CANCEL]</span></a></strong>
                                <input name="calculate" type="submit" class="style114" value="Calculate" />
                                <input name="reset" type="reset" class="style114" id="reset" value="Reset" />
                                <input type="submit" name="submit" id="submit"  value="Submit" />
              </span></span></span></div></td>
            </tr>
            <tr>
              <td height="34">&nbsp;</td>
              <td>&nbsp;</td>
              <td colspan="2"><div align="right"><span class="style108 style72 style71 style71"><span class="style114"> </span> </span></div>
                      <p>&nbsp;</p></td>
            </tr>
            <tr>
              <td height="34"><span class="style71"></span></td>
              <td><span class="style71"></span></td>
              <td colspan="2"><div align="right" class="style108 style72 style71 style71"></div></td>
            </tr>
          </table>
        </form></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="36"><div align="right">
      <hr />
      <div align="right"><span class="style86 style87"><img src="images/phone.JPG" width="19" height="14" /></span> <span class="style85 style87">03-61863050 <img src="images/fax.JPG" width="19" height="14" /> 03-61858472 <img src="images/email.JPG" width="19" height="14" />webmastermds@yahoo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="style95">All Rights Reserved © INTEGOMB MDS 2011</span></div>
    </div></td>
  </tr>
</table>
</body>
</html>
<?php
}?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.