can anyone take alook at my code, i dont get errors or anything but it doesnt save in my db??? please ... thanks!
<?php
if(isset($_POST[save]))
{
//student,grade,section,subject
$ids=$_POST['id'];
$grades=$_POST['fg'];
$secs=$_POST['secs'];
$subs=$_POST['subs'];
$yirs=$g_year['acad_id'];
debug($_POST);
if(isset($_POST['save']))
{
unset($_POST['save']);
$i = count($_POST['id']); $x = 0;
for($x=0; $x <$i;$x++){
foreach($_POST as $data =>$d){
echo $data.'-'.$d[$x].'<br/>';
$num_entry=count($d);
$insert="INSERT INTO tbl_firstgrading {$data} VALUES (";
for($i=0;$i<$num_entry;$i++){
if($i!=$num_entry){
$insert.="$d,";
}
else
{
$result=mysql_query($insert)or die(mysql_error());
}
}
//sql statement here (example): insert into table name (value ng $data) values( value ng $d[$x]) --
}}}}
?>
<?php function debug($arr){ echo "
"; print_r($arr); echo "
"; } ?>