Jump to content

help getting array values ( I am almost there)


gammaman

Recommended Posts

I know this will seem like a double post but I am very close.

 

This code receives user input information from text boxes for a specific field in which specific rows of that field have no information and stores them into an array.  Now when I do my query to put that user information into the field, it puts element zero into all of the rows that have no information.  I want it to put element zero in the first record with a field with no information, and the element one into the next record with a field with no information, and so on.

 


  session_start();
   $_SESSION['admin']['admins'];

   echo "{$_SESSION['admin']['admins']}";

   $_SESSION['admin']['adminpass'];

   $_SESSION['checkaddGrades']['stuid'];

   $Grade = ($_POST['grd']);

   print_r($Grade);


   $result=mysql_query("select CourseID,CourseName,Grade From Rcourse
                  WHERE StudentID='{$_SESSION['checkaddGrades']['stuid']}'");
    $cou=mysql_num_rows($result);
    echo $cou;
    while ($row=mysql_fetch_array($result))
    {
     
     //$CourseID= $row['CourseID'];          
     //$grade = $row['Grade'];
     //$Course=$row['CourseName'];
     
     foreach ($Grade as $itm){
     mysql_query("Update Rcourse set Grade = '$itm' where Grade < 'A' AND  StudentID='{$_SESSION['checkaddGrades']['stuid']}'")
          or die(mysql_error()); 
     }
   }       
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.