Jump to content

help with array and query


gammaman

Recommended Posts

I have a query that is using an array from a form on the previous page.  The array prints.  I used print_r and the values are getting passed.  However I try to use them in an update query and when the page loads, it loads as a blank page.

 

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

   print_r($Grade);


   $result=mysql_query("select CourseID,CourseName,Grade From Rcourse
                  WHERE StudentID='{$_SESSION['student']['user']}'");
    $cou=mysql_num_rows($result);
    
    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['student']['user']}'");
     }
   }       

Link to comment
https://forums.phpfreaks.com/topic/103137-help-with-array-and-query/
Share on other sites

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.