gammaman Posted April 27, 2008 Share Posted April 27, 2008 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 More sharing options...
BlueSkyIS Posted April 27, 2008 Share Posted April 27, 2008 mysql_query($sql) or die(mysql_error()) should become a habit. otherwise, there is nothing in the posted code that is outputting anything to the browser, thus the blank page. unless you're not showing us all the code. Link to comment https://forums.phpfreaks.com/topic/103137-help-with-array-and-query/#findComment-528280 Share on other sites More sharing options...
gammaman Posted April 27, 2008 Author Share Posted April 27, 2008 Not true because it should still print the array because I am using the print_r and now I do not see anything. Link to comment https://forums.phpfreaks.com/topic/103137-help-with-array-and-query/#findComment-528281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.