Hi i'am try to insert multiple data on a single submit, but i'm a total noob to Arrays, can any one help me out here... one of the members send me this out, but still i can figure it out how to insert the fields onto my database. it inserts but doesnt get the valuee.. Please help!
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/>';
$insert = mysql_query("insert into tbl_grades");
//sql statement here (example): insert into table name (value of $data) values( value of$d[$x]) --
[B]//HOW DO I MAKE MY SQL QUERY TO SAVE THIS OUT, I KNOW THIS IS MY PROBLEM IN THE QUERY....[/B]
HTML CODE:S/
<input name="id[]" type="hidden" value="<?php echo $row['id'];?>" />
1st<input name="fg[]" type="text" id="fg[]" size="1" value="<?php $g_sub['sub_id'];?>"/>
2nd<input name="sg[]" type="text" id="sg[]" size="1" value="<?php $g_sub['sub_id'];?>"/>
3rd<input name="tg[]" type="text" id="tg[]" size="1" value="<?php $g_sub['sub_id'];?>"/>
4th <input name="forg[]" type="text" id="forg[]" size="1" value="<?php $g_sub['sub_id'];?>"/> ---- sub_id stands for subject id